Cake\Shell\RoutesShell::check PHP Method

check() public method

Checks a url for the route that will be applied.
public check ( string $url ) : null | false
$url string The URL to parse
return null | false
    public function check($url)
    {
        try {
            $route = Router::parse($url);
            foreach (Router::routes() as $r) {
                if ($r->match($route)) {
                    $name = isset($r->options['_name']) ? $r->options['_name'] : $r->getName();
                    break;
                }
            }
            unset($route['_matchedRoute']);
            $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;
        }
    }