The coding standard documentation currently makes no mention of the alternative control structure syntax for template files (see http://www.php.net/manual/control-structures.alternative-syntax.php), although there is a related comment http://drupal.org/coding-standards#comment-5433408. The documentation should be updated to include this variation with examples such as:
<?php if (!empty($item)): ?>
<p><?php print $item; ?></p>
<?php endif; ?>
and
<?php foreach ($items as $item): ?>
<p><?php print $item; ?></p>
<?php endforeach; ?>
The documentation should also indicate that there should not be a space between the closing parenthesis and the colon as mentioned in #999040: Coding standards: Alternative control structure syntax in theme templates.
Comments
Comment #1
jhodgdonWe normally discuss coding standards on a Drupal Core issue.
Comment #2
BassistJimmyJam CreditAttribution: BassistJimmyJam commentedMy mistake, thank you for moving it to the correct location.
Comment #3
jhodgdonAh, just noticed you had linked to this other issue #999040: Coding standards: Alternative control structure syntax in theme templates where the coding standard was discussed.
Given that the standard has been agreed to, I went ahead an edited the coding standards page to add this to the Control Structures section:
http://drupal.org/coding-standards#controlstruct