Route registration service.
More...
Route registration service.
Definition at line 19 of file RouteRegistrationService.php.
Elgg\Router\RouteRegistrationService::all |
( |
| ) |
|
Elgg\Router\RouteRegistrationService::generateUrl |
( |
|
$name, |
|
|
array |
$parameters = [] |
|
) |
| |
Generate a absolute URL for a named route.
- Parameters
-
string | $name | Route name |
array | $parameters | Query parameters |
- Returns
- false|string
Definition at line 195 of file RouteRegistrationService.php.
Elgg\Router\RouteRegistrationService::get |
( |
|
$name | ) |
|
Elgg\Router\RouteRegistrationService::register |
( |
|
$name, |
|
|
array |
$params = [] |
|
) |
| |
Register a new route.
Route paths can contain wildcard segments, i.e. /blog/owner/{username} To make a certain wildcard segment optional, add ? to its name, i.e. /blog/owner/{username?}
Wildcard requirements for common named variables such as 'guid' and 'username' will be set automatically.
- Parameters
-
string | $name | Unique route name This name can later be used to generate route URLs |
array | $params | Route parameters
- path : path of the route
- resource : name of the resource view
- defaults : default values of wildcard segments
- requirements : regex patterns for wildcard segment requirements
- methods : HTTP methods
|
- Returns
- Route
- Exceptions
-
Definition at line 80 of file RouteRegistrationService.php.
Elgg\Router\RouteRegistrationService::registerPageHandler |
( |
|
$identifier, |
|
|
|
$function |
|
) |
| |
Register a function that gets called when the first part of a URL is equal to the identifier.
- Parameters
-
string | $identifier | The page type to handle |
callable | $function | Your function name |
- Returns
- bool Depending on success
- Exceptions
-
Definition at line 267 of file RouteRegistrationService.php.
Elgg\Router\RouteRegistrationService::resolveRouteParameters |
( |
|
$name, |
|
|
ElggEntity |
$entity = null , |
|
|
array |
$parameters = [] |
|
) |
| |
Elgg\Router\RouteRegistrationService::unregister |
( |
|
$name | ) |
|
Elgg\Router\RouteRegistrationService::unregisterPageHandler |
( |
|
$identifier | ) |
|
Unregister a page handler for an identifier.
- Parameters
-
string | $identifier | The page type identifier |
- Returns
- void
Definition at line 294 of file RouteRegistrationService.php.
Elgg\Router\RouteRegistrationService::$generator |
|
protected |
Elgg\Router\RouteRegistrationService::$hooks |
|
protected |
Elgg\Router\RouteRegistrationService::$routes |
|
protected |
The documentation for this class was generated from the following file: