예제 #1
0
 /**
  * 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));
 }
예제 #2
0
 /**
  * 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.");
 }
예제 #3
0
 /**
  * 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));
 }