Nextcloud PHP API (stable18)

IURLGenerator

Class to generate URLs

Tags
since
6.0.0

Table of Contents

getAbsoluteURL()  : string
Makes an URL absolute
getBaseUrl()  : string
imagePath()  : string
Returns the link to an image, like linkTo but only with prepending img/
linkTo()  : string
Returns an URL for an image or file
linkToDocs()  : string
linkToOCSRouteAbsolute()  : string
linkToRoute()  : string
Returns the URL for a route
linkToRouteAbsolute()  : string
Returns the absolute URL for a route

Methods

getAbsoluteURL()

Makes an URL absolute

public getAbsoluteURL(string $url) : string
Parameters
$url : string

the url in the ownCloud host

Tags
since
6.0.0
Return values
string

the absolute version of the url

getBaseUrl()

public getBaseUrl() : string
Tags
since
13.0.0
Return values
string

base url of the current request

imagePath()

Returns the link to an image, like linkTo but only with prepending img/

public imagePath(string $appName, string $file) : string
Parameters
$appName : string

the name of the app

$file : string

the name of the file

Tags
since
6.0.0
Return values
string

the url

linkTo()

Returns an URL for an image or file

public linkTo(string $appName, string $file[, array $args = array() ]) : string
Parameters
$appName : string

the name of the app

$file : string

the name of the file

$args : array = array()

array with param=>value, will be appended to the returned url The value of $args will be urlencoded

Tags
since
6.0.0
Return values
string

the url

linkToDocs()

public linkToDocs(string $key) : string
Parameters
$key : string
Tags
since
8.0.0
Return values
string

url to the online documentation

linkToOCSRouteAbsolute()

public linkToOCSRouteAbsolute(string $routeName[, array $arguments = [] ]) : string
Parameters
$routeName : string
$arguments : array = []
Tags
since
15.0.0
Return values
string

linkToRoute()

Returns the URL for a route

public linkToRoute(string $routeName[, array $arguments = array() ]) : string
Parameters
$routeName : string

the name of the route

$arguments : array = array()

an array with arguments which will be filled into the url

Tags
since
6.0.0
Return values
string

the url

linkToRouteAbsolute()

Returns the absolute URL for a route

public linkToRouteAbsolute(string $routeName[, array $arguments = array() ]) : string
Parameters
$routeName : string

the name of the route

$arguments : array = array()

an array with arguments which will be filled into the url

Tags
since
8.0.0
Return values
string

the absolute url

Search results