Moodle PHP Documentation 5.1
Moodle 5.1dev (Build: 20250706) (a6b17d8f6bd)
Slim\Routing\Route Class Reference
Inheritance diagram for Slim\Routing\Route:
Slim\Interfaces\RouteInterface Psr\Http\Server\RequestHandlerInterface

Public Member Functions

 add ($middleware)
 {
Parameters
MiddlewareInterface | string | callable$middleware
}
 
 addMiddleware (MiddlewareInterface $middleware)
 {}
 
 getArgument (string $name, ?string $default=null)
 {Retrieve a specific route argument.}
 
 getArguments ()
 {Get route arguments.
Return values
array<string,string>
}
 
 getCallable ()
 {Get route callable.
Return values
callable|string
}
 
 getCallableResolver ()
 
 getGroups ()
 
 getIdentifier ()
 {Get the route's unique identifier.}
 
 getInvocationStrategy ()
 {Get route invocation strategy.}
 
 getMethods ()
 {Get route methods.
Return values
string[]
}
 
 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.
Parameters
array<string,string>$arguments
}
 
 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.
Parameters
callable | string$callable
}
 
 setInvocationStrategy (InvocationStrategyInterface $invocationStrategy)
 {Set route invocation strategy.}
 
 setName (string $name)
 {Set route name.
Return values
static
}
 
 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.
 

Member Function Documentation

◆ add()

Slim\Routing\Route::add ( $middleware)

{

Parameters
MiddlewareInterface | string | callable$middleware
}

Implements Slim\Interfaces\RouteInterface.

◆ addMiddleware()

Slim\Routing\Route::addMiddleware ( MiddlewareInterface $middleware)

◆ appendGroupMiddlewareToRoute()

Slim\Routing\Route::appendGroupMiddlewareToRoute ( )
protected
Return values
void

◆ getArgument()

Slim\Routing\Route::getArgument ( string $name,
?string $default = null )

{Retrieve a specific route argument.}

Implements Slim\Interfaces\RouteInterface.

◆ getArguments()

Slim\Routing\Route::getArguments ( )

{Get route arguments.

Return values
array<string,string>
}

Implements Slim\Interfaces\RouteInterface.

◆ getCallable()

Slim\Routing\Route::getCallable ( )

{Get route callable.

Return values
callable|string
}

Implements Slim\Interfaces\RouteInterface.

◆ getGroups()

Slim\Routing\Route::getGroups ( )
Return values
RouteGroupInterface[]

◆ getIdentifier()

Slim\Routing\Route::getIdentifier ( )

{Get the route's unique identifier.}

Implements Slim\Interfaces\RouteInterface.

◆ getInvocationStrategy()

Slim\Routing\Route::getInvocationStrategy ( )

{Get route invocation strategy.}

Implements Slim\Interfaces\RouteInterface.

◆ getMethods()

Slim\Routing\Route::getMethods ( )

{Get route methods.

Return values
string[]
}

Implements Slim\Interfaces\RouteInterface.

◆ getName()

Slim\Routing\Route::getName ( )

{Get route name.}

Implements Slim\Interfaces\RouteInterface.

◆ getPattern()

Slim\Routing\Route::getPattern ( )

{Get route pattern.}

Implements Slim\Interfaces\RouteInterface.

◆ handle()

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.

◆ prepare()

Slim\Routing\Route::prepare ( array $arguments)

{Prepare the route for use.

Parameters
array<string,string>$arguments
}

Implements Slim\Interfaces\RouteInterface.

◆ run()

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.

◆ setArguments()

Slim\Interfaces\RouteInterface::setArguments ( array $arguments)
inherited

Replace route arguments.

Parameters
array<string,string>$arguments

◆ setCallable()

Slim\Routing\Route::setCallable ( $callable)

{Set route callable.

Parameters
callable | string$callable
}

Implements Slim\Interfaces\RouteInterface.

◆ setInvocationStrategy()

Slim\Routing\Route::setInvocationStrategy ( InvocationStrategyInterface $invocationStrategy)

{Set route invocation strategy.}

Implements Slim\Interfaces\RouteInterface.

◆ setName()

Slim\Routing\Route::setName ( string $name)

{Set route name.

Return values
static
}

Implements Slim\Interfaces\RouteInterface.

◆ setPattern()

Slim\Routing\Route::setPattern ( string $pattern)

{Set route pattern.}

Implements Slim\Interfaces\RouteInterface.

Member Data Documentation

◆ methods

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-> Slim\Routing\Route::methods = $methods
protected

Route parameters.

string>


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