ControllerCollection
class ControllerCollection
Builds Silex controllers.
It acts as a staging area for routes. You are able to set the route name until flush() is called, at which point all controllers are frozen and converted to a RouteCollection.
__call() forwards method-calls to Route, but returns instance of ControllerCollection listing Route's methods below, so that IDEs know they are valid
Properties
protected | $controllers | ||
protected | $defaultRoute | ||
protected | $defaultController | ||
protected | $prefix | ||
protected | $routesFactory | ||
protected | $controllersFactory |
Methods
No description
Mounts controllers under the given route prefix.
Maps a pattern to a callable.
Maps a GET request to a callable.
Maps a POST request to a callable.
Maps a PUT request to a callable.
Maps a DELETE request to a callable.
Maps an OPTIONS request to a callable.
Maps a PATCH request to a callable.
No description
Persists and freezes staged controllers.
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
at line 49
__construct(Route $defaultRoute, RouteCollection $routesFactory = null, $controllersFactory = null)
at line 67
mount(string $prefix, ControllerCollection|callable $controllers)
Mounts controllers under the given route prefix.
at line 92
Controller
match(string $pattern, mixed $to = null)
Maps a pattern to a callable.
You can optionally specify HTTP methods that should be matched.
at line 110
Controller
get(string $pattern, mixed $to = null)
Maps a GET request to a callable.
at line 123
Controller
post(string $pattern, mixed $to = null)
Maps a POST request to a callable.
at line 136
Controller
put(string $pattern, mixed $to = null)
Maps a PUT request to a callable.
at line 149
Controller
delete(string $pattern, mixed $to = null)
Maps a DELETE request to a callable.
at line 162
Controller
options(string $pattern, mixed $to = null)
Maps an OPTIONS request to a callable.
at line 175
Controller
patch(string $pattern, mixed $to = null)
Maps a PATCH request to a callable.
at line 180
__call($method, $arguments)
at line 200
RouteCollection
flush()
Persists and freezes staged controllers.