Skip to content

Instantly share code, notes, and snippets.

@gbili
Created April 6, 2013 12:47
Show Gist options
  • Save gbili/5326002 to your computer and use it in GitHub Desktop.
Save gbili/5326002 to your computer and use it in GitHub Desktop.
bread
<ul class="breadcrumb">
<?php $lastPageKey = count($this->pages) - 1?>
<?php var_dump($this->pages) //blank page?>
<?php foreach ($this->pages as $key => $page): // iterate through the pages?>
<li><?php get_class($pages) //error, expects object array given?></li>
<li>
<?php if ($key < $lastPageKey): // if this isn't the last page, add a link and the separator?>
<a href="<?= $page->getHref() ?>"><?= $page->getLabel() ?></a>
<span class="divider">/</span>
<?php else: // otherwise, just output the name ?>
<?= $page->getLabel() ?>
<?php endif ?>
</li>
<?php endforeach ?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment