JasonLewis\EnhancedRouter\Router::getRoutes PHP Méthode

getRoutes() public méthode

Overloaded so that we can merge route groups.
public getRoutes ( ) : RouteCollection
Résultat Symfony\Component\Routing\RouteCollection
    public function getRoutes()
    {
        $this->mergeRouteGroups();
        return parent::getRoutes();
    }

Usage Example

 public function testOrderOfRoutesIsMaintainted()
 {
     $router = new Router();
     $router->group(array('prefix' => 'foo'), function () use($router) {
         $router->get('bar', function () {
         });
     });
     $router->get('baz', function () {
     });
     $routes = array_keys($router->getRoutes()->all());
     $this->assertEquals(array('get foo/bar', 'get baz'), $routes);
 }