10-25-2007, 03:58 PM
|
#29 (permalink)
|
|
Moderateur
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
|
Quote:
Originally Posted by Karl
PHP Code:
<div>
<?php if ($something = 1): ?>
Something else...
<?php endif; ?>
</div>
I think it looks better than using the curly braces.
|
Not only does it "look better" but when you scan over your template and see a line with just <?php } ?> it can be troublesome to match up the corresponding opening brace (unless you're very, very strict about your code structure).
I use the "alternative" syntax for if, while, for, foreach... blocks almost exclusively in my template files for the reasons discussed already. It just makes life easier.
|
|
|
|