public function check($url)
    {
        try {
            $request = new ServerRequest(['url' => $url]);
            $route = Router::parseRequest($request);
            $name = null;
            foreach (Router::routes() as $r) {
                if ($r->match($route)) {
                    $name = isset($r->options['_name']) ? $r->options['_name'] : $r->getName();
                    break;
                }
            }

            unset($route['_matchedRoute']);
            ksort($route);

            $output = [
                ['Route name', 'URI template', 'Defaults'],
                [$name, $url, json_encode($route)]
            ];
            $this->helper('table')->output($output);
            $this->out();
        } catch (MissingRouteException $e) {
            $this->warn("'$url' did not match any routes.");
            $this->out();

            return false;
        }

        return true;
    }
public function check($url)
    {
        try {
            $request = new ServerRequest(['url' => $url]);
            $route = Router::parseRequest($request);
            $name = null;
            foreach (Router::routes() as $r) {
                if ($r->match($route)) {
                    $name = isset($r->options['_name']) ? $r->options['_name'] : $r->getName();
                    break;
                }
            }

            unset($route['_matchedRoute']);
            ksort($route);

            $output = [
                ['Route name', 'URI template', 'Defaults'],
                [$name, $url, json_encode($route)]
            ];
            $this->helper('table')->output($output);
            $this->out();
        } catch (MissingRouteException $e) {
            $this->warn("'$url' did not match any routes.");
            $this->out();

            return false;
        }

        return true;
    }
public function check ( $ url ) { try { $ request = new ServerRequest ( [ 'url' => $ url ] ) ; $ route = Router :: parseRequest ( $ request ) ; $ name = null ; foreach ( Router :: routes ( ) as $ r ) { if ( $ r -> match ( $ route ) ) { $ name = isset ( $ r -> options [ '_name' ] ) ? $ r -> options [ '_name' ] : $ r -> getName ( ) ; break ; } } unset ( $ route [ '_matchedRoute' ] ) ; ksort ( $ route ) ; $ output = [ [ 'Route name' , 'URI template' , 'Defaults' ] , [ $ name , $ url , json_encode ( $ route ) ] ] ; $ this -> helper ( 'table' ) -> output ( $ output ) ; $ this -> out ( ) ; } catch ( MissingRouteException $ e ) { $ this -> warn ( "'$url' did not match any routes." ) ; $ this -> out ( ) ; return false ; } return true ; }
Checks a url for the route that will be applied.

@param string $url The URL to parse
@return bool Success
Checks a url for the route that will be applied .