Moodle PHP Documentation 4.5
Moodle 4.5.5+ (Build: 20250711) (ce34e8ff087)
core\router\util Class Reference

Static Public Member Functions

static get_path_for_callable (string|array|callable $callable, array $params, array $queryparams,)
 Get the URI path for the specified callable.
 
static get_route_instance_for_method (callable|array|string $callable)
 Get the instance of the route::router::route attribute for the specified callable if one is available.
 
static get_route_instance_for_request (ServerRequestInterface $request)
 Get the route attribute for the specified request.
 
static get_route_name_for_callable (callable|array|string $callable,)
 Get the route name for the specified callable.
 
static redirect_to_callable (callable|array|string $callable, array $params=[],)
 Redirect to the route at the callable supplied.
 
static redirect_with_params (string|moodle_url $path, array $excludeparams=[],)
 Redirect to the specified URL, carrying all parameters across too.
 

Member Function Documentation

◆ get_path_for_callable()

static core\router\util::get_path_for_callable ( string|array|callable $callable,
array $params,
array $queryparams )
static

Get the URI path for the specified callable.

Parameters
string | array | callable$callablethe Callable to get the URI for
array$paramsAny parameters to include in the path
array$queryparamsAny parameters to include in the query string
Return values
moodle_url

◆ get_route_instance_for_method()

static core\router\util::get_route_instance_for_method ( callable|array|string $callable)
static

Get the instance of the route::router::route attribute for the specified callable if one is available.

Parameters
callable | array | string$callable
Return values
null|routeThe route if one was found.

◆ get_route_instance_for_request()

static core\router\util::get_route_instance_for_request ( ServerRequestInterface $request)
static

Get the route attribute for the specified request.

Parameters
ServerRequestInterface$request
Return values
null|route

◆ get_route_name_for_callable()

static core\router\util::get_route_name_for_callable ( callable|array|string $callable)
static

Get the route name for the specified callable.

Parameters
callable | array | string$callable
Return values
string
Exceptions
coding_exceptionIf the callable could not be resolved into an Array format

◆ redirect_to_callable()

static core\router\util::redirect_to_callable ( callable|array|string $callable,
array $params = [] )
static

Redirect to the route at the callable supplied.

Parameters
callable | array | string$callable
array$paramsAny parameters to include in the path @codeCoverageIgnore

◆ redirect_with_params()

static core\router\util::redirect_with_params ( string|moodle_url $path,
array $excludeparams = [] )
static

Redirect to the specified URL, carrying all parameters across too.

Parameters
string | moodle_url$path
array$excludeparamsAny parameters to exclude from the query params @codeCoverageIgnore

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