IRouter
Interface IRouter
Tags
Table of Contents
- create() : IRoute
- Create a \OCP\Route\IRoute.
- generate() : string
- Generate url based on $name and $parameters
- getCacheKey() : string
- getCurrentCollection() : string
- returns the current collection name in use for adding routes
- getGenerator() : mixed
- Get the url generator
- getRoutingFiles() : string[]
- Get the files to load the routes from
- loadRoutes() : mixed
- Loads the routes
- match() : void
- Find the route matching $url.
- useCollection() : void
- Sets the collection to use for adding routes
Methods
create()
Create a \OCP\Route\IRoute.
public
create(string $name, string $pattern[, array $defaults = [] ][, array $requirements = [] ]) : IRoute
Parameters
- $name : string
-
Name of the route to create.
- $pattern : string
-
The pattern to match
- $defaults : array = []
-
An array of default parameter values
- $requirements : array = []
-
An array of requirements for parameters (regexes)
Tags
Return values
IRoute —generate()
Generate url based on $name and $parameters
public
generate(string $name[, array $parameters = [] ][, bool $absolute = false ]) : string
Parameters
- $name : string
-
Name of the route to use.
- $parameters : array = []
-
Parameters for the route
- $absolute : bool = false
Tags
Return values
string —getCacheKey()
public
getCacheKey() : string
Tags
Return values
string —getCurrentCollection()
returns the current collection name in use for adding routes
public
getCurrentCollection() : string
Tags
Return values
string —the collection name
getGenerator()
Get the url generator
public
getGenerator() : mixed
Tags
Return values
mixed —getRoutingFiles()
Get the files to load the routes from
public
getRoutingFiles() : string[]
Tags
Return values
string[] —loadRoutes()
Loads the routes
public
loadRoutes([null|string $app = null ]) : mixed
Parameters
- $app : null|string = null
Tags
Return values
mixed —match()
Find the route matching $url.
public
match(string $url) : void
Parameters
- $url : string
-
The url to find
Tags
useCollection()
Sets the collection to use for adding routes
public
useCollection(string $name) : void
Parameters
- $name : string
-
Name of the collection to use.