Defines a new route that will intercept all HTTP requests

@param   string $path The path to match
@param   callable $action An action that will be executed
@param   string $name (optional) Route name

@return  HttpRoute
775889
public function all(string $path, callable $action, string $name = null): HttpRoute
    {
        return $this->handle($path, $action, ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'], $name);
    }
1272560
public function match($path, $method, $action = null)
    {
        $rule = new Rule\HttpMethodRule();
        $rule->setPath($path);
        $rule->setMethod($method);
        $rule->setAction($action);
        $this->rules[] = $rule;
        return $rule;
    }
805078
final public function add(string $name, $path): RouteConfigurator
    {
        $paths = [];
        $parentConfigurator = $this instanceof CollectionConfigurator ? $this : ($this instanceof RouteConfigurator ? $this->parentConfigurator : null);

        if (\is_array($path)) {
            if (null === $this->prefixes) {
                $paths = $path;
            } elseif ($missing = array_diff_key($this->prefixes, $path)) {
                throw new \LogicException(sprintf('Route "%s" is missing routes for locale(s) "%s".', $name, implode('", "', array_keys($missing))));
            } else {
                foreach ($path as $locale => $localePath) {
                    if (!isset($this->prefixes[$locale])) {
                        throw new \LogicException(sprintf('Route "%s" with locale "%s" is missing a corresponding prefix in its parent collection.', $name, $locale));
                    }

                    $paths[$locale] = $this->prefixes[$locale].$localePath;
                }
            }
        } elseif (null !== $this->prefixes) {
            foreach ($this->prefixes as $locale => $prefix) {
                $paths[$locale] = $prefix.$path;
            }
        } else {
            $this->collection->add($this->name.$name, $route = $this->createRoute($path));

            return new RouteConfigurator($this->collection, $route, $this->name, $parentConfigurator, $this->prefixes);
        }

        $routes = new RouteCollection();

        foreach ($paths as $locale => $path) {
            $routes->add($name.'.'.$locale, $route = $this->createRoute($path));
            $this->collection->add($this->name.$name.'.'.$locale, $route);
            $route->setDefault('_locale', $locale);
            $route->setDefault('_canonical_route', $this->name.$name);
        }

        return new RouteConfigurator($this->collection, $routes, $this->name, $parentConfigurator, $this->prefixes);
    }
472579
public function put($path, $action = null)
    {
        return $this->match($path, HttpMethodRule::HTTP_METHOD_PUT, $action);
    }
1355901
protected function setResourceIndex($name, $controller, $action, $options = [])
    {
        return $this->router->match(
            strtoupper('get'),
            $name,
            function () use ($controller, $action) {
                $args = [$controller . '@' . 'get' . ucfirst($action)];

                return $this->router->callController($args);
            }
        );
    }
434780
public function routePage($path)
    {
        $url = URL::findByLocation($path);

        if ($url) {
            $page = $url->getPage();

            if (!$page || $page->isDeleted()) {
                // The url is in use but doesn't have a page.
                // The page must have been deleted.
                throw new GoneHttpException();
            }

            if (Editor::isDisabled() && !$page->isVisible()) {
                throw new NotFoundHttpException();
            }

            if (!$page->url()->matches($path)) {
                return redirect((string) $page->url(), 301);
            }

            $this->setActivePage($page);

            return;
        }

        throw new NotFoundHttpException();
    }
886977
public function create($url, $method, $action)
	{
		return new Route(
			$this->parseUrl($url), 
			$this->parseArguments($url),
			$this->parseMethod($method), 
			$action
		);
	}
779661
public function addRoute(string $path, string $controller, string $action = 'index', string $method = Request::METHOD_GET) : self
    {
        $endPoint = new RouteEndpoint($this->namespace, $controller, $action, $method);
        $this->routes[] = new Route($path, $endPoint);
        
        return $this;
    }
208205
public static function has_action( $path, $action = null ) 
	{
		$path = CCStr::cut( $path, '@' );
		$path = CCStr::cut( $path, '?' );
		
		// fix closure given
		if ( !is_string( $path ) )
		{
			return false;	
		}
		
		// get controllers default action
		if ( is_null( $action ) ) 
		{
			$action = static::$_default_action;
		}
		
		// try to load the controller
		if ( !$controller = static::create( $path ) ) 
		{
			return false;
		}
		
		return method_exists( $controller, static::$_action_prefix.$action );
	}
416683
public static function set($method, $path, $action)
    {
        if (is_array($method)) {
            foreach ($method as $value) {
                self::set($value, $path, $action);
            }
        } else {
            if (is_string($action)) {
                $action = parent::$prefixNS . $action;
            } elseif ($action !== null && !$action instanceof \Closure) {
                return null;
            }

            $method = strtoupper(trim($method));

            $path = parent::$prefixPath . $path;

            if (!isset(parent::$httpRoutes[$path])) {
                parent::$httpRoutes[$path] = array();
            }

            parent::$httpRoutes[$path][$method] = $action;
        }
    }
936014
public function addPathHeader(string $name, $path)
    {
        return $this->add(new PathHeader($name, $path instanceof Address ? $path : new Address($path)));
    }
885564
public function delete(string $name, string $path, $target, array $matchers = []) : self
    {
        $route = $this->createRoute([RequestMethodInterface::METHOD_DELETE], $name, $path, $target, $matchers);
        $this->addRoute($route);
        return $this;
    }
63094
public function get(string $route, $action, ?string $name = null): Route
	{
		return $this->registerRoute(['GET', 'HEAD', 'OPTIONS'], $route, $action, $name);
	}
1100899
public function head($pattern, $action, $name = null)
    {
        return $this->addRoute(['HEAD'], $pattern, $action, $name);
    }
154627
private function setLocation($path, $name)
    {
        $this->paths[$this->where][$name][] = $path;

        return $this;
    }
1116737
public static function url($name, $parameters = []) {
		return URequest::getUrl ( self::getRouteByName ( $name, $parameters, false ) );
	}
7297
private function _routeCron($src, $controller, $action) {
        $this->request->name = '-' . $src . '_' . $controller . '_' . $action;
        $this->request->src = $src;
        $this->request->controller = $controller;
        $this->request->action = $action;
        $this->request->auth = new Auth($this->request->src);
        $this->_route = true;
    }