コード例 #1
0
 public function add($name, TrailInterface $trail, $root = null)
 {
     $this->remove($name);
     if (null !== $root) {
         $root = $this->get($root);
         $crumbs = array_merge($root->getCrumbs(), $trail->getCrumbs());
         $trail->setCrumbs($crumbs);
     }
     $this->trails[$name] = $trail;
 }
コード例 #2
0
ファイル: ListRenderer.php プロジェクト: redpanda/breadcrumbs
 public function render(TrailInterface $trail)
 {
     $res = '<ul>';
     foreach ($trail->getCrumbs() as $crumb) {
         $res .= '<li' . $this->renderAttributes($crumb->getAttributes()) . '>';
         $res .= $this->renderCrumb($crumb);
         $res .= '</li>';
     }
     $res .= '</ul>';
     return $res;
 }