src/Router.php
public function route($route, $prefix = null)
    {
        $this->route = substr($route, strlen($prefix));
        $parameters = [];

        // Go through predefined routes till a match is found
        foreach ($this->routeOrder as $routeName) {
            $routeDescription = $this->routes[$routeName];
            $parameters = $this->match($this->route, $routeDescription);
            if ($parameters !== false) {
                return [
                    'route' => $this->route,
                    'parameters' => $this->fillInDefaultParameters($routeDescription, $parameters),
                    'description' => $routeDescription
                ];
            }
        }
        return [
            'route' => $this->route,
            'parameters' => $parameters,
            'description' => $this->routes['default']
        ];
    }
public function route($route, $prefix = null)
    {
        $this->route = substr($route, strlen($prefix));
        $parameters = [];

        // Go through predefined routes till a match is found
        foreach ($this->routeOrder as $routeName) {
            $routeDescription = $this->routes[$routeName];
            $parameters = $this->match($this->route, $routeDescription);
            if ($parameters !== false) {
                return [
                    'route' => $this->route,
                    'parameters' => $this->fillInDefaultParameters($routeDescription, $parameters),
                    'description' => $routeDescription
                ];
            }
        }
        return [
            'route' => $this->route,
            'parameters' => $parameters,
            'description' => $this->routes['default']
        ];
    }
public function route ( $ route , $ prefix = null ) { $ this -> route = substr ( $ route , strlen ( $ prefix ) ) ; $ parameters = [ ] ; // Go through predefined routes till a match is found foreach ( $ this -> routeOrder as $ routeName ) { $ routeDescription = $ this -> routes [ $ routeName ] ; $ parameters = $ this -> match ( $ this -> route , $ routeDescription ) ; if ( $ parameters !== false ) { return [ 'route' => $ this -> route , 'parameters' => $ this -> fillInDefaultParameters ( $ routeDescription , $ parameters ) , 'description' => $ routeDescription ] ; } } return [ 'route' => $ this -> route , 'parameters' => $ parameters , 'description' => $ this -> routes [ 'default' ] ] ; }
Invoke the router to load a route.

@param string $route
@param string $prefix
@return array
Invoke the router to load a route .