Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250711) (9addea9f0ac)
core\router\abstract_route_loader Class Reference
Inheritance diagram for core\router\abstract_route_loader:
core\router\route_loader core\tests\router\mocking_route_loader

Protected Member Functions

 get_all_routes_in_class (string $componentpath, ReflectionClass $classinfo,)
 Get all routes in a class.
 
 get_all_routes_in_namespace (string $namespace, callable $componentpathcallback, ?callable $filtercallback=null,)
 Get all routes in the namespace.
 
 get_route_attribute_for_method (ReflectionClass $classinfo, ReflectionMethod $methodinfo,)
 Get the route attribute for the specified method.
 
 get_route_data_for_method (string $componentpath, ReflectionClass $classinfo, ReflectionMethod $methodinfo,)
 Get route data for a single method in a class.
 
 normalise_component_path (string $component,)
 Normalise the component for use as part of the path.
 
 set_route_name_for_callable (RouteInterface $slimroute, string|array|callable $callable,)
 Set a route name for the specified callable.
 

Member Function Documentation

◆ get_all_routes_in_class()

core\router\abstract_route_loader::get_all_routes_in_class ( string $componentpath,
ReflectionClass $classinfo )
protected

Get all routes in a class.

Parameters
string$componentpathThe path to the component that the class belongs to
ReflectionClass$classinfoThe class to get the routes for
Return values
array[]

◆ get_all_routes_in_namespace()

core\router\abstract_route_loader::get_all_routes_in_namespace ( string $namespace,
callable $componentpathcallback,
?callable $filtercallback = null )
protected

Get all routes in the namespace.

Parameters
string$namespaceThe namespace to get the routes for
callable$componentpathcallbackA callback to get the component path for a class
null | callable$filtercallbackA callback to use to filter routes before they are added
Return values
array[]

◆ get_route_attribute_for_method()

core\router\abstract_route_loader::get_route_attribute_for_method ( ReflectionClass $classinfo,
ReflectionMethod $methodinfo )
protected

Get the route attribute for the specified method.

Note: If a parent has a route, but the method does not, no route will be returned.

Parameters
ReflectionClass$classinfoThe class to get the route attribute for
ReflectionMethod$methodinfoThe method to get the route attribute for
Return values
null|route

◆ get_route_data_for_method()

core\router\abstract_route_loader::get_route_data_for_method ( string $componentpath,
ReflectionClass $classinfo,
ReflectionMethod $methodinfo )
protected

Get route data for a single method in a class.

Parameters
string$componentpathThe path to the component that the class belongs to
ReflectionClass$classinfoThe class to get the route data for
ReflectionMethod$methodinfoThe method to get the route data for
Return values
null|array[]

◆ normalise_component_path()

core\router\abstract_route_loader::normalise_component_path ( string $component)
protected

Normalise the component for use as part of the path.

If the component is a subsystem, the core_ prefix will be removed. If the component is 'core', it will be kept. All other components will use their frankenstyle name.

Parameters
string$component
Return values
string

◆ set_route_name_for_callable()

core\router\abstract_route_loader::set_route_name_for_callable ( RouteInterface $slimroute,
string|array|callable $callable )
protected

Set a route name for the specified callable.

Parameters
RouteInterface$slimroute
string | array | callable$callable
Return values
string|nullThe name of the route if it was set, otherwise null

The documentation for this class was generated from the following file: