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; }
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; }