ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
RouteGroup.php
Go to the documentation of this file.
1 <?php
9 namespace Slim;
10 
11 use Closure;
13 
19 class RouteGroup extends Routable implements RouteGroupInterface
20 {
27  public function __construct($pattern, $callable)
28  {
29  $this->pattern = $pattern;
30  $this->callable = $callable;
31  }
32 
38  public function __invoke(App $app = null)
39  {
40  $callable = $this->resolveCallable($this->callable);
41  if ($callable instanceof Closure && $app !== null) {
42  $callable = $callable->bindTo($app);
43  }
44 
45  $callable($app);
46  }
47 }
Definition: App.php:46
__invoke(App $app=null)
Invoke the group to register any Routable objects within it.
Definition: RouteGroup.php:38
__construct($pattern, $callable)
Create a new RouteGroup.
Definition: RouteGroup.php:27
Slim Framework (https://slimframework.com)
Definition: App.php:9