public function add($title, $options = '')
{
$item = new Item($this, $this->id(), $title, $options);
$this->items->push($item);
$this->lastId = $item->id;
return $item;
}
/** * Adds a sub item to the menu. * * @param string $title * @param array|string $options * @return \Caffeinated\Menus\Item */ 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); }