Welcome Guest, Not a member yet? Register   Sign In
In views use <?php echo $title; ?> or <?=$title?> ?
#9

[eluser]Georgi Budinov[/eluser]
As juanvillegas already said having differnt php styles in one file/project - brings mess to the code.

This looks very nice
Code:
&lt;?=isset($alabala)?'<div>'.$alabala.'</div>':''?&gt;

but when you have a more complex statement this is getting ugly. So you have to mix statement syntax.
On the other hand I try not to write html tags in php strings e.g. '<div>'.$alabala ...

So I generally prefer the one that perhaps most of you do not like:

Code:
&lt;?php
if(isset($alabala))
{
?&gt;
   <div>&lt;?php echo $alabala; ?&gt;</div>
&lt;?php } ?&gt;

Note here that I do NOT write
Code:
&lt;?php if(isset($alabala)) { ?&gt;
because it is easy to miss that '{' or erase by mistake.


Messages In This Thread
In views use &lt;?php echo $title; ?&gt; or &lt;?=$title?&gt; ? - by El Forum - 09-13-2010, 05:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB