/** * Get the URL to a controller action. * * @param string $action * @param mixed $parameters * @param bool $absolute * @return string */ public function action($action, $parameters = array(), $absolute = true) { if ($this->rootNamespace && !(strpos($action, '\\') === 0)) { $action = $this->rootNamespace . '\\' . $action; } else { $action = trim($action, '\\'); } return $this->route($action, $parameters, $absolute, $this->routes->getByAction($action)); }
/** * Get the URL to a controller action. * * @param string $action * @param mixed $parameters * @param bool $absolute * @return string * * @throws \InvalidArgumentException */ public function action($action, $parameters = [], $absolute = true) { if ($this->rootNamespace && !(strpos($action, '\\') === 0)) { $action = $this->rootNamespace . '\\' . $action; } else { $action = trim($action, '\\'); } if (!is_null($route = $this->routes->getByAction($action))) { return $this->toRoute($route, $parameters, $absolute); } throw new InvalidArgumentException("Action {$action} not defined."); }
/** * Get the URL to a controller action. * * @param string $action * @param mixed $parameters * @param bool $absolute * @return string */ public function action($action, $parameters = array(), $absolute = true) { return $this->route($action, $parameters, $absolute, $this->routes->getByAction($action)); }