Nextcloud PHP API (stable18)

IRouter

Interface IRouter

Tags
since
7.0.0
deprecated
9.0.0

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() ][, array $requirements = array() ]) : IRoute
Parameters
$name : string

Name of the route to create.

$pattern : string

The pattern to match

$defaults : array = array()

An array of default parameter values

$requirements : array = array()

An array of requirements for parameters (regexes)

Tags
since
7.0.0
deprecated
9.0.0
Return values
IRoute

generate()

Generate url based on $name and $parameters

public generate(string $name[, array $parameters = array() ][, bool $absolute = false ]) : string
Parameters
$name : string

Name of the route to use.

$parameters : array = array()

Parameters for the route

$absolute : bool = false
Tags
since
7.0.0
deprecated
9.0.0
Return values
string

getCacheKey()

public getCacheKey() : string
Tags
since
7.0.0
deprecated
9.0.0
Return values
string

getCurrentCollection()

returns the current collection name in use for adding routes

public getCurrentCollection() : string
Tags
since
8.0.0
deprecated
9.0.0
Return values
string

the collection name

getGenerator()

Get the url generator

public getGenerator() : mixed
Tags
since
7.0.0
deprecated
9.0.0
Return values
mixed

getRoutingFiles()

Get the files to load the routes from

public getRoutingFiles() : string[]
Tags
since
7.0.0
deprecated
9.0.0
Return values
string[]

loadRoutes()

Loads the routes

public loadRoutes([null|string $app = null ]) : mixed
Parameters
$app : null|string = null
Tags
since
7.0.0
deprecated
9.0.0
Return values
mixed

match()

Find the route matching $url.

public match(string $url) : void
Parameters
$url : string

The url to find

Tags
throws
Exception
since
7.0.0
deprecated
9.0.0

useCollection()

Sets the collection to use for adding routes

public useCollection(string $name) : void
Parameters
$name : string

Name of the collection to use.

Tags
since
7.0.0
deprecated
9.0.0

Search results