public function dispatch($options)
{
if (isset($options['url'])) {
return $this->getUrl($options);
} elseif (isset($options['route'])) {
return $this->getRoute($options['route']);
} elseif (isset($options['action'])) {
return $this->getAction($options['action']);
}
return null;
}
/** * Generates a valid URL for the menu item. * * @return string */ public function url() { if (!is_null($this->link)) { if ($this->link->href) { return $this->link->href; } return $this->builder->dispatch($this->link->path); } }