Reverted to Symfony 2.0's signature, which made it simple to display only a subset of the routes of the application.
This is particularly useful for FOSJsRoutingBundle's fos:js-routing:debug command, which allows to filter the list of javascript-exposed routes.
This commit is contained in:
parent
884a8264b3
commit
e44e21c2e9
@ -74,11 +74,13 @@ EOF
|
||||
}
|
||||
}
|
||||
|
||||
protected function outputRoutes(OutputInterface $output)
|
||||
protected function outputRoutes(OutputInterface $output, $routes = null)
|
||||
{
|
||||
$routes = array();
|
||||
foreach ($this->getContainer()->get('router')->getRouteCollection()->all() as $name => $route) {
|
||||
$routes[$name] = $route->compile();
|
||||
if (null === $routes) {
|
||||
$routes = array();
|
||||
foreach ($this->getContainer()->get('router')->getRouteCollection()->all() as $name => $route) {
|
||||
$routes[$name] = $route->compile();
|
||||
}
|
||||
}
|
||||
|
||||
$output->writeln($this->getHelper('formatter')->formatSection('router', 'Current routes'));
|
||||
|
Reference in New Issue
Block a user