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

[eluser]Derek Jones[/eluser]
Quote:but here we have a dilemma we must solve, about the statement mentioned above e.g. &lt;?=isset($alabala)?’<div>’.$alabala.’</div>’:’‘?&gt;:

To me, it's not a dilemma. I don't use ternary operators in View files, for my previously stated reasons. I also set <em>all</em> view variables, so I'd use:

Code:
&lt;?php if ($alabala): ?&gt;
    <div>&lt;?=$alabala?&gt;</div>
&lt;? endif; ?&gt;

It's a bit more verbose, but to me far more legible, particularly to non-coders.

Quote:It is personal/team point of view.

Quite, and that hits the nail on the head. Almost akin to coding style, the important thing is that you and your team choose one way and stick to it consistently.


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



Theme © iAndrew 2016 - Forum software by © MyBB