com\setasign\SetaFramework\Router\Route
File Class Route File
File: /SetaFramework/src/Router/Route/File.php
Class hierarchy
Implements
- \Psr\Log\LoggerAwareInterface
- RouteInterface
Summary
Properties
$defaultValues
protected array<string, mixed> File::$defaultValues
$requestPathPrefix
protected ?string File::$requestPathPrefix
Methods
__construct()
public File::__construct (
string $file,
array<string, mixed> $defaultValues = array ( ),
?string $requestPathPrefix = null
)array<string, mixed> $defaultValues = array ( ),
?string $requestPathPrefix = null
Constructor
The File Route match if you try to call a special file ($file).
If the requestPathPrefix doesn't match the route will fail.
Parameters
- $file : string
Filename with path, exclude the requestPathPrefix
- $defaultValues : array<string, mixed>
- $requestPathPrefix : ?string
match()
Checks whether this route matches to the request
Parameters
- $request : \Psr\Http\Message\RequestInterface
Return Values
Returns associative array(without any numeric key) with values or NULL if the route not match
Exceptions
Throws \com\setasign\SetaFramework\Router\RouteException If $request is no server request
setDefaultValue()
Sets a key of the defaultValues array
Parameters
- $key : string
The key shouldn't be a natural number
- $value : mixed
setDefaultValues()
Overwrites the defaultValues array
Parameters
- $defaultValues : array<string, mixed>
The keys of this array shouldn't be natural numbers
