Wednesday 15 June 2011

magento - Simple if statement not working [nested php tags] -


Here is the code below, I am trying to say whether that block is equal or less than 1000px height Show logos and texting lessons. I do not know what I am doing wrong. Please remember that it is inside magento. Is this a better way of writing me that I think right with jquery?

  & lt ;? Php if (css class = gt; = height of 62px): echo & lt; H1 class = "logo" & gt; & Lt; Strong & gt; & Lt ;? Php echo $ this- & gt; GetLogoAlt ()? & Gt; & Lt; / Strong> & Lt; A href = "& lt ;? php echo $ this-> getUrl ('')? & Gt;" Title = "& lt ;? php echo $ this-> getLogoAlt ()? & Gt;" Class = "logo" & gt; & Lt; Img src = "& lt ;? Php echo $ this-> getLogoSrc ()? & Gt;" & Lt ;? Php echo MAGE :: Assistant ('Theme Options / Retina') - & gt; GetRetinaData ('logo'); ? & Gt; Alt = "& lt ;? php echo $ this-> getLogoAlt ()? & Gt;" / & Gt; & Lt; / A & gt; & Lt; / H1> '; Else: Echo '& lt; P & gt; Trial & lt; / P & gt; '; end if; ? & Gt;    

Learn to see the beautiful straightforward comment code, its structure. It is prepared in a special way on which it is used.

Nested PHP tags do not work

  & lt ;? Php if: & lt ;? Php ...? & Gt; ? & Gt;   

For php scripting where php code is central and HTML is being prepared as echo statement, this structure is:

  & lt ? Php if (CSS class = gt; = height of 62px) {echo & lt; H1 class = "logo" & gt; & Lt; Strong & gt; '. $ This- & gt; GetLogoAlt () '& lt; / Strong> '; Echo '& lt; A href = "'. $ This- & gt; getUrl (' ').' 'Title ="'. $ This- & gt; GetLogoAlt (). ' 'Class = "logo" & gt;'; Echo '& lt; ('Theme Options / Retina') - & gt; GetRetinaData ('Logo'). '' Alt = "'$ This - & gt; getLogoAlt () '' & gt;; echo '' & lt; / a & gt; & lt; / h1 & gt; & # 39;;;} Other {echo & lt; p & gt; trial & lt; / P & gt; ';}? & Gt;   

For HTML scripting where the HTML tags are prominent and the PHP code is included in the tag as HTML, this is the structure :

  & lt ;? php if (css class> = height 62px):? & Gt; & lt; h1 class = "logo" & gt; & lt; strong & gt; ; & Lt ;? php echo $ this- & gt; getLogoAlt ()? & Gt; & lt; / strong & gt; & lt; a href = "& lt;? Php echo $ this- & gt; GetUrl ('')? & Gt; "Title =" & lt ;? Php echo $ this- & gt; GetLogoAlt ()? & Gt; "Class =" logo "& gt; & lt; img src =" & lt ;; Php $ echo-> it-> GetLogoSrc ()? & Gt; "& Lt ;? Php Echo Table :: Helipor ('Theme Option / Retina') - & gt; GetRetinaData ('Logo')? & Gt; alt =" & lt;? Php echo $ this- & gt; GetLogoAlt ()? & Gt; "/> & Lt; / a & gt; & lt; / h1 & gt; & lt ;? php other:? & Gt; & lt; p & gt; Trial & lt; / p & gt; & lt ; Php Androp;;>   

Note: To present this code type in this if test and some other things It should be done with pseudocode, probably not actually usable Magento php. Mor e work with it.

No comments:

Post a Comment