Illuminate\Routing\Router::createRoute PHP Метод

createRoute() защищенный Метод

Create a new route instance.
protected createRoute ( array | string $methods, string $uri, mixed $action ) : Illuminate\Routing\Route
$methods array | string
$uri string
$action mixed
Результат Illuminate\Routing\Route
    protected function createRoute($methods, $uri, $action)
    {
        // If the route is routing to a controller we will parse the route action into
        // an acceptable array format before registering it and creating this route
        // instance itself. We need to build the Closure that will call this out.
        if ($this->actionReferencesController($action)) {
            $action = $this->convertToControllerAction($action);
        }
        $route = $this->newRoute($methods, $this->prefix($uri), $action);
        // If we have groups that need to be merged, we will merge them now after this
        // route has already been created and is ready to go. After we're done with
        // the merge we will be ready to return the route back out to the caller.
        if ($this->hasGroupStack()) {
            $this->mergeGroupAttributesIntoRoute($route);
        }
        $this->addWhereClausesToRoute($route);
        return $route;
    }

Usage Example

Пример #1
0
 /**
  * Create a new route instance.
  *
  * @param  array|string  $methods
  * @param  string  $uri
  * @param  mixed   $action
  * @return \Illuminate\Routing\Route
  */
 protected function createRoute($methods, $uri, $action)
 {
     $route = parent::createRoute($methods, $uri, $action);
     if (!empty($this->groupStack)) {
         $this->mergePriority($route);
     }
     return $route;
 }
All Usage Examples Of Illuminate\Routing\Router::createRoute