Skip to content

Instantly share code, notes, and snippets.

@jimbojsb
Created March 18, 2013 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimbojsb/5188438 to your computer and use it in GitHub Desktop.
Save jimbojsb/5188438 to your computer and use it in GitHub Desktop.
viewhelper
<?php
namespace Genoa\Viewhelper;
class Breadcrumbs
{
protected $crumbs;
public function __construct($items)
{
foreach ($items as $text => $link) {
if ($link) {
$crumbs[] = '<a href="' . $link . '">' . $text . '</a>';
} else {
$crumbs[] = $text;
}
}
$this->crumbs = $crumbs;
}
public function __toString()
{
return implode(' &gt; ', $this->crumbs);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment