Created
April 6, 2013 12:47
-
-
Save gbili/5326002 to your computer and use it in GitHub Desktop.
bread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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