Link to home
Start Free TrialLog in
Avatar of charmingduck
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): ?>
  <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; ?>

Open in new window

Avatar of dsmile
dsmile
Flag of Viet Nam image

It's the syntax of drupal template

<?php if($test == 1): ?>
do something
<?php else: ?>
do something else
<?php endif; ?>

<?php foreach($items as $item): ?>
<?php echo $item->getTitle(); ?>
<?php endforeach; ?>
You can consider it as "start of condition/block statement"
Avatar of charmingduck
charmingduck

ASKER

thanks, can I find more details about the ':' on the drupal website?
ASKER CERTIFIED SOLUTION
Avatar of dsmile
dsmile
Flag of Viet Nam image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks so much