Delegates requests to controllers based on the registered configuration.
More...
Delegates requests to controllers based on the registered configuration.
Plugin devs should use elgg_register_route() to register a named route or define it in elgg-plugin.php
- Since
- 1.9.0
Definition at line 26 of file Router.php.
Constructor.
- Parameters
-
Definition at line 40 of file Router.php.
Elgg\Router::allowRewrite |
( |
HttpRequest |
$request | ) |
|
Filter a request through the 'route:rewrite' event.
- Parameters
-
\Elgg\Http\Request | $request | Elgg request |
- Returns
- Exceptions
-
Definition at line 260 of file Router.php.
Elgg\Router::getResponse |
( |
HttpRequest |
$request | ) |
|
Build a response.
- Parameters
-
- Returns
- ResponseBuilder
- Exceptions
-
Definition at line 84 of file Router.php.
Elgg\Router::getResponseFromFile |
( |
string |
$file, |
|
|
\Elgg\Request |
$request |
|
) |
| |
|
protected |
Get response from file.
- Parameters
-
string | $file | File |
\Elgg\Request | $request | Request envelope |
- Returns
- ResponseBuilder|null
- Exceptions
-
Definition at line 229 of file Router.php.
Elgg\Router::getResponseFromHandler |
( |
|
$handler, |
|
|
\Elgg\Request |
$request |
|
) |
| |
|
protected |
Get response from handler function.
- Parameters
-
callable | $handler | Legacy page handler function |
\Elgg\Request | $request | Request envelope |
- Returns
- ResponseBuilder|null
Definition at line 192 of file Router.php.
Elgg\Router::prepareResponse |
( |
HttpRequest |
$request | ) |
|
|
protected |
Prepare response.
- Parameters
-
- Returns
- ResponseBuilder|null
- Exceptions
-
BadRequestException | |
PageNotFoundException | |
Definition at line 109 of file Router.php.
Elgg\Router::route |
( |
HttpRequest |
$request | ) |
|
Routes the request to a registered page handler.
This function triggers a `'route', $identifier` event so that plugins can modify the routing or handle a request.
- Parameters
-
\Elgg\Http\Request | $request | The request to handle. |
- Returns
- boolean Whether the request was routed successfully.
Definition at line 60 of file Router.php.
The documentation for this class was generated from the following file: