Neos\Flow\Mvc\Routing\Router::addRoute PHP Метод

addRoute() публичный Метод

Manually adds a route to the beginning of the configured routes
public addRoute ( Route $route ) : void
$route Route
Результат void
    public function addRoute(Route $route)
    {
        $this->createRoutesFromConfiguration();
        array_unshift($this->routes, $route);
    }

Usage Example

 /**
  * Adds a route that can be used in the functional tests
  *
  * @param string $name Name of the route
  * @param string $uriPattern The uriPattern property of the route
  * @param array $defaults An array of defaults declarations
  * @param boolean $appendExceedingArguments If exceeding arguments may be appended
  * @param array $httpMethods An array of accepted http methods
  * @return Route
  * @api
  */
 protected function registerRoute($name, $uriPattern, array $defaults, $appendExceedingArguments = false, array $httpMethods = null)
 {
     $route = new Route();
     $route->setName($name);
     $route->setUriPattern($uriPattern);
     $route->setDefaults($defaults);
     $route->setAppendExceedingArguments($appendExceedingArguments);
     if ($httpMethods !== null) {
         $route->setHttpMethods($httpMethods);
     }
     $this->router->addRoute($route);
     return $route;
 }