ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
RouteGroup.php
Go to the documentation of this file.
1<?php
9namespace Slim;
10
11use Closure;
13
19class 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}
An exception for terminatinating execution or to throw for unit testing.
__construct($pattern, $callable)
Create a new RouteGroup.
Definition: RouteGroup.php:27
__invoke(App $app=null)
Invoke the group to register any Routable objects within it.
Definition: RouteGroup.php:38
Slim Framework (https://slimframework.com)
Definition: App.php:9