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;
}
}