View Single Post
Old 10-25-2007, 03:58 PM   #29 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Karl View Post
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.
Salathe is offline  
Reply With Quote