public function add($title, $options = '')
{
if (!is_array($options)) {
$url = $options;
$options = array();
$options['url'] = $url;
}
$options['parent'] = $this->id;
return $this->builder->add($title, $options);
}
/** * Build a child menu item as the descendent of a previously created menu item. * * @param MenuModel $descendant * @param MenuItem|MenuBuilder $menuItem parent menu item * @return MenuItem */ protected function renderChildNode(MenuModel $descendant, $menuItem) { /** @var MenuItem $childNode */ $childNode = $menuItem->add($descendant->name, $this->getMenuData($descendant)); return $childNode; }