charmingduck
asked on
drupal coding
Please see attached, why is there a colon at the end of the if statement? what does it do?
<?php if (!$page): ?>
<?php if (!$page): ?>
<?php if (!$page): ?>
<h2><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
<?php endif; ?>
<?php if ($submitted): ?>
<span class="submitted"><?php print $submitted; ?></span>
<?php endif; ?>
You can consider it as "start of condition/block statement"
ASKER
thanks, can I find more details about the ':' on the drupal website?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks so much
<?php if($test == 1): ?>
do something
<?php else: ?>
do something else
<?php endif; ?>
<?php foreach($items as $item): ?>
<?php echo $item->getTitle(); ?>
<?php endforeach; ?>