/** * Get a sfSympalMenuBreadcrumbs instances for the given MenuItem * * @param MenuItem $menuItem The MenuItem instance to generate the breadcrumbs for * @param string $subItem A string to append to the end of the breadcrumbs * @return string $html */ function get_sympal_breadcrumbs($menuItem, $subItem = null) { if (!$menuItem) { return false; } // If we were passed an array then generate manual breacrumbs from it if (is_array($menuItem)) { $breadcrumbs = sfSympalMenuBreadcrumbs::generate($menuItem); } else { $breadcrumbs = $menuItem->getBreadcrumbs($subItem); } if ($html = (string) $breadcrumbs) { return $html; } else { return false; } }
public function getBreadcrumbs($subItem = null) { $breadcrumbs = null; // Get the menu this menu item belongs to if ($menu = $this->getMenu()) { // Find the node for this menu item $node = $menu->findMenuItem($this); // Get the breadcrumbs if ($node) { $breadcrumbs = $node->getBreadcrumbs($subItem); } } // If no breadcrumbs generate a blank object if (is_null($breadcrumbs)) { $breadcrumbs = sfSympalMenuBreadcrumbs::generate(array()); } return $breadcrumbs; }
public function getBreadcrumbs($subItem = null) { return sfSympalMenuBreadcrumbs::generate($this->getBreadcrumbsArray($subItem)); }