Class Controller
A route controller.
Accessing the application's properties
The class tries to retrieve undefined properties from the application, so the following code yields the same results:
<?php $this->app->models # or $this->models
But because request
is defined by the controller the following code might not yield the same
results:
<?php $this->app->request # or $this->request
- ICanBoogie\Prototyped
- ┗ ICanBoogie\Routing\Controller
Direct known subclasses
Methods summary
protected
get_name( void )
: string|null
Return the name of the controller, extracted from its class name.
final public
__invoke( ICanBoogie\HTTP\Request $request
)
: ICanBoogie\HTTP\Response|mixed
Controls the route and returns a response.
abstract protected
action( ICanBoogie\HTTP\Request $request
)
: ICanBoogie\HTTP\Response|mixed
Performs the proper action for the request.
public
redirect( ICanBoogie\Routing\Route
|string $url
, integer $status
= Status::FOUND, array $headers
= [] )
: ICanBoogie\HTTP\RedirectResponse
Redirects the request.
protected
forward_to_route( ICanBoogie\Routing\Route
$route
)
: ICanBoogie\HTTP\Response|mixed
Forwards dispatching to another router.