Hey I'm new to php and codeigniter. I know that in codeigniter view you can repeat a variable like
<?php echo $var ?>
but if, say, I do not pass the variable $ var, I get a nasty
<h4>A PHP Error was encountered</h4>
in my html source code. I worked with django before the template, if the variable does not exist, they simply do not display it. Is there a way in php / codeigniter to say "if $ var exists, something else does nothing"?
I tried:
<?php if($title): ?> <?php echo $title ?> <?php endif; ?>
but it was a mistake. Thanks!
source share