FrontpageRoute
extends Route
in package
This attribute can be used to define Frontpage routes on controller methods.
It works in addition to the traditional routes.php method and has the same parameters
(except for the name
parameter which is not needed).
Tags
Attributes
- #[Attribute]
- \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE
Table of Contents
Constants
- TYPE_API = 'ocs'
- Corresponds to the `ocs` key in routes.php
- TYPE_FRONTPAGE = 'routes'
- Corresponds to the `routes` key in routes.php
Properties
- $defaults : array<string|int, mixed>|null
- $postfix : string|null
- $requirements : array<string|int, mixed>|null
- $root : string|null
- $type : string
- $url : string
- $verb : string
Methods
- __construct() : mixed
- getDefaults() : array<string|int, mixed>|null
- getPostfix() : string|null
- getRequirements() : array<string|int, mixed>|null
- getRoot() : string|null
- getType() : string
- getUrl() : string
- getVerb() : string
-
toArray()
: array{verb: string, url: string, requirements?: array
, defaults?: array , root?: string, postfix?: string}
Constants
TYPE_API
Corresponds to the `ocs` key in routes.php
public
mixed
TYPE_API
= 'ocs'
Tags
TYPE_FRONTPAGE
Corresponds to the `routes` key in routes.php
public
mixed
TYPE_FRONTPAGE
= 'routes'
Tags
Properties
$defaults
protected
array<string|int, mixed>|null
$defaults
= null
$postfix
protected
string|null
$postfix
= null
$requirements
protected
array<string|int, mixed>|null
$requirements
= null
$root
protected
string|null
$root
= null
$type
protected
string
$type
$url
protected
string
$url
$verb
protected
string
$verb
Methods
__construct()
public
__construct(string $verb, string $url[, array<string|int, mixed>|null $requirements = null ][, array<string|int, mixed>|null $defaults = null ][, string|null $root = null ][, string|null $postfix = null ]) : mixed
Parameters
- $verb : string
-
HTTP method of the route.
- $url : string
-
The path of the route.
- $requirements : array<string|int, mixed>|null = null
-
Array of regexes mapped to the path parameters.
- $defaults : array<string|int, mixed>|null = null
-
Array of default values mapped to the path parameters.
- $root : string|null = null
-
Custom root. For OCS all apps are allowed, but for index.php only some can use it.
- $postfix : string|null = null
-
Postfix for the route name.
Tags
getDefaults()
public
getDefaults() : array<string|int, mixed>|null
Tags
Return values
array<string|int, mixed>|nullgetPostfix()
public
getPostfix() : string|null
Tags
Return values
string|nullgetRequirements()
public
getRequirements() : array<string|int, mixed>|null
Tags
Return values
array<string|int, mixed>|nullgetRoot()
public
getRoot() : string|null
Tags
Return values
string|nullgetType()
public
getType() : string
Tags
Return values
stringgetUrl()
public
getUrl() : string
Tags
Return values
stringgetVerb()
public
getVerb() : string
Tags
Return values
stringtoArray()
public
toArray() : array{verb: string, url: string, requirements?: array, defaults?: array, root?: string, postfix?: string}