group() публичный Метод

Create a route group with shared attributes. Overloading this method allows developers to chain requirements and filters to all routes within the group.
public group ( array $attributes, Closure $callback ) : JasonLewis\EnhancedRouter\RouteGroup
$attributes array
$callback Closure
Результат JasonLewis\EnhancedRouter\RouteGroup
Пример #1
0
 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);
 }