Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
|
Public Member Functions | ||||
add ($middleware) | ||||
{
| ||||
addMiddleware (MiddlewareInterface $middleware) | ||||
{} | ||||
getArgument (string $name, ?string $default=null) | ||||
{Retrieve a specific route argument.} | ||||
getArguments () | ||||
{Get route arguments.
| ||||
getCallable () | ||||
{Get route callable.
| ||||
getCallableResolver () | ||||
getGroups () | ||||
getIdentifier () | ||||
{Get the route's unique identifier.} | ||||
getInvocationStrategy () | ||||
{Get route invocation strategy.} | ||||
getMethods () | ||||
{Get route methods.
| ||||
getName () | ||||
{Get route name.} | ||||
getPattern () | ||||
{Get route pattern.} | ||||
handle (ServerRequestInterface $request) | ||||
{Handles a request and produces a response.May call other collaborating code to generate the response.} | ||||
prepare (array $arguments) | ||||
{Prepare the route for use.
| ||||
run (ServerRequestInterface $request) | ||||
{Run route.This method traverses the middleware stack, including the route's callable and captures the resultant HTTP response object. It then sends the response back to the Application.} | ||||
setArgument (string $name, string $value) | ||||
Set a route argument. | ||||
setArgument (string $name, string $value, bool $includeInSavedArguments=true) | ||||
{} | ||||
setArguments (array $arguments) | ||||
Replace route arguments. | ||||
setArguments (array $arguments, bool $includeInSavedArguments=true) | ||||
{} | ||||
setCallable ($callable) | ||||
{Set route callable.
| ||||
setInvocationStrategy (InvocationStrategyInterface $invocationStrategy) | ||||
{Set route invocation strategy.} | ||||
setName (string $name) | ||||
{Set route name.
| ||||
setPattern (string $pattern) | ||||
{Set route pattern.} | ||||
Public Attributes | |
$this | callable = $callable |
$this | callableResolver = $callableResolver |
$this | container = $container |
$this | groups = $groups |
$this | identifier = 'route' . $identifier |
$this | invocationStrategy = $invocationStrategy ?? new RequestResponse() |
$this | middlewareDispatcher = new MiddlewareDispatcher($this, $callableResolver, $container) |
$this | pattern = $pattern |
$this | responseFactory = $responseFactory |
Protected Member Functions | |
appendGroupMiddlewareToRoute () | |
Protected Attributes | |
RouteGroupInterface[] array | $groups |
Parent route groups. | |
string | $identifier |
Route identifier. | |
InvocationStrategyInterface | $invocationStrategy |
string[] array | $methods = [] |
HTTP methods supported by this route. | |
string | $name = null |
Route name. | |
array< string, array $arguments=[];protected string[] array $savedArguments=[];protected ?ContainerInterface $container=null;protected MiddlewareDispatcher $middlewareDispatcher;protected callable|string $callable;protected CallableResolverInterface $callableResolver;protected ResponseFactoryInterface $responseFactory;protected string $pattern;protected bool $groupMiddlewareAppended=false;public function __construct(array $methods, string $pattern, $callable, ResponseFactoryInterface $responseFactory, CallableResolverInterface $callableResolver, ?ContainerInterface $container=null, ?InvocationStrategyInterface $invocationStrategy=null, array $groups=[], int $identifier=0) { $this-> | methods = $methods |
Route parameters. | |
Slim\Routing\Route::add | ( | $middleware | ) |
{
MiddlewareInterface | string | callable | $middleware |
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::addMiddleware | ( | MiddlewareInterface | $middleware | ) |
{}
Implements Slim\Interfaces\RouteInterface.
|
protected |
void |
Slim\Routing\Route::getArgument | ( | string | $name, |
?string | $default = null ) |
{Retrieve a specific route argument.}
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::getArguments | ( | ) |
{Get route arguments.
array<string,string> |
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::getCallable | ( | ) |
Slim\Routing\Route::getGroups | ( | ) |
RouteGroupInterface[] |
Slim\Routing\Route::getIdentifier | ( | ) |
{Get the route's unique identifier.}
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::getInvocationStrategy | ( | ) |
{Get route invocation strategy.}
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::getMethods | ( | ) |
Slim\Routing\Route::getName | ( | ) |
{Get route name.}
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::getPattern | ( | ) |
{Get route pattern.}
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::handle | ( | ServerRequestInterface | $request | ) |
{Handles a request and produces a response.May call other collaborating code to generate the response.}
Implements Psr\Http\Server\RequestHandlerInterface.
Slim\Routing\Route::prepare | ( | array | $arguments | ) |
{Prepare the route for use.
array<string,string> | $arguments |
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::run | ( | ServerRequestInterface | $request | ) |
{Run route.This method traverses the middleware stack, including the route's callable and captures the resultant HTTP response object. It then sends the response back to the Application.}
Implements Slim\Interfaces\RouteInterface.
|
inherited |
Replace route arguments.
array<string,string> | $arguments |
Slim\Routing\Route::setCallable | ( | $callable | ) |
{Set route callable.
callable | string | $callable |
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::setInvocationStrategy | ( | InvocationStrategyInterface | $invocationStrategy | ) |
{Set route invocation strategy.}
Implements Slim\Interfaces\RouteInterface.
Slim\Routing\Route::setName | ( | string | $name | ) |
Slim\Routing\Route::setPattern | ( | string | $pattern | ) |
{Set route pattern.}
Implements Slim\Interfaces\RouteInterface.
|
protected |
Route parameters.
string>