| Elgg
    Version 6.3
    | 
Route registration service. More...
| Public Member Functions | |
| __construct (protected EventsService $events, protected RouteCollection $routes, protected UrlGenerator $generator, protected SessionManagerService $session_manager, protected Plugins $plugins) | |
| Constructor.  More... | |
| register (string $name, array $params=[]) | |
| Register a new route.  More... | |
| unregister (string $name) | |
| Unregister a route by its name.  More... | |
| get (string $name) | |
| Get route config from its name.  More... | |
| all () | |
| Get all registered routes.  More... | |
| generateUrl (string $name, array $parameters=[]) | |
| Generate a absolute URL for a named route.  More... | |
| resolveRouteParameters (string $name, ?\ElggEntity $entity=null, array $parameters=[]) | |
| Populates route parameters from entity properties.  More... | |
Route registration service.
Definition at line 18 of file RouteRegistrationService.php.
| Elgg\Router\RouteRegistrationService::__construct | ( | protected EventsService | $events, | 
| protected RouteCollection | $routes, | ||
| protected UrlGenerator | $generator, | ||
| protected SessionManagerService | $session_manager, | ||
| protected Plugins | $plugins | ||
| ) | 
Constructor.
| EventsService | $events | Events service | 
| RouteCollection | $routes | Route collection | 
| UrlGenerator | $generator | URL Generator | 
| SessionManagerService | $session_manager | Session manager service | 
| Plugins | $plugins | Plugins | 
Definition at line 31 of file RouteRegistrationService.php.
| Elgg\Router\RouteRegistrationService::all | ( | ) | 
Get all registered routes.
Definition at line 196 of file RouteRegistrationService.php.
| Elgg\Router\RouteRegistrationService::generateUrl | ( | string | $name, | 
| array | $parameters = [] | ||
| ) | 
Generate a absolute URL for a named route.
| string | $name | Route name | 
| array | $parameters | Query parameters | 
Definition at line 208 of file RouteRegistrationService.php.
| Elgg\Router\RouteRegistrationService::get | ( | string | $name | ) | 
Get route config from its name.
| string | $name | Route name | 
Definition at line 188 of file RouteRegistrationService.php.
| Elgg\Router\RouteRegistrationService::register | ( | string | $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 commonly named variables such as 'guid' and 'username' will be set automatically.
| string | $name | Unique route name This name can later be used to generate route URLs | 
| array | $params | Route parameters 
 | 
| InvalidArgumentException | 
Definition at line 63 of file RouteRegistrationService.php.
| Elgg\Router\RouteRegistrationService::resolveRouteParameters | ( | string | $name, | 
| ?\ElggEntity | $entity = null, | ||
| array | $parameters = [] | ||
| ) | 
Populates route parameters from entity properties.
Definition at line 245 of file RouteRegistrationService.php.
| Elgg\Router\RouteRegistrationService::unregister | ( | string | $name | ) | 
Unregister a route by its name.
| string | $name | Name of the route | 
Definition at line 177 of file RouteRegistrationService.php.