router
class router implements router_interface
| internal |
Router.
Handles the storage, context resolution, and URL generation for routes. Delegates the discovery (loading) of routes to route_loader_interface.
Constants
| private ENTRY_POINT |
|
Methods
No description
Initializes the Routing Context based on the current Globals.
Retrieve the registered route collection.
Get the current routing context (host, scheme, base path).
Registers default system routes (e.g. 404) and global regex patterns.
Manually registers a route.
Delegates scanning to the Loader.
Generates a URL for a given route.
Details
at line 63
__construct(route_loader_interface|null $loader = new route_loader())
No description
at line 72
void
initialize_context()
Initializes the Routing Context based on the current Globals.
Sets the base URL specific to this Moodle plugin.
at line 87
RouteCollection
get_routes()
Retrieve the registered route collection.
at line 97
RequestContext|null
get_context()
Get the current routing context (host, scheme, base path).
at line 105
void
register_default_routes()
Registers default system routes (e.g. 404) and global regex patterns.
at line 130
void
register(string $name, string $path, string $controller, string $method, array $requirements = [])
Manually registers a route.
at line 143
void
scan_annotations(ContainerInterface $container, string|null $specific_class = null)
Delegates scanning to the Loader.
at line 164
moodle_url
generate_url(string $route, array $parameters = [], int $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH)
Generates a URL for a given route.