URLGenerator

class OC\URLGenerator
Class to generate URLs
Source:lib/private/URLGenerator.php#53
Implements:OCP\IURLGenerator

Properties

Methods

public OC\URLGenerator::__construct($config, $cacheFactory, $request, $router)
Source:lib/private/URLGenerator.php#65
public OC\URLGenerator::linkToRoute($routeName, $arguments=[])
Creates an url using a defined route
Source:

lib/private/URLGenerator.php#84

Parameters:
  • $routeName (string)
  • $arguments (array) args with param=>value, will be appended to the returned url
Returns:

string the url

Returns a url to the given route.

public OC\URLGenerator::linkToRouteAbsolute($routeName, $arguments=[])
Creates an absolute url using a defined route
Source:

lib/private/URLGenerator.php#96

Parameters:
  • $routeName (string)
  • $arguments (array) args with param=>value, will be appended to the returned url
Returns:

string the url

Returns an absolute url to the given route.

public OC\URLGenerator::linkToOCSRouteAbsolute($routeName, $arguments=[])
Source:lib/private/URLGenerator.php#100
public OC\URLGenerator::linkTo($appName, $file, $args=[])
Creates an url
Source:

lib/private/URLGenerator.php#125

Parameters:
  • $appName (string) app
  • $file (string) file
  • $args (array) array with param=>value, will be appended to the returned url

The value of $args will be urlencoded

Returns:

string the url

Returns a url to the given app and file.

public OC\URLGenerator::imagePath($appName, $file)
Creates path to an image
Source:

lib/private/URLGenerator.php#173

Parameters:
  • $appName (string) app
  • $file (string) image name
Throws:

\RuntimeException If the image does not exist

Returns:

string the url

Returns the path to the image.

public OC\URLGenerator::getAbsoluteURL($url)
Makes an URL absolute
Source:

lib/private/URLGenerator.php#247

Parameters:
  • $url (string) the url in the ownCloud host
Returns:

string the absolute version of the url

public OC\URLGenerator::linkToDocs($key)
Source:

lib/private/URLGenerator.php#265

Parameters:
  • $key (string)
Returns:

string url to the online documentation

public OC\URLGenerator::getBaseUrl()
Source:lib/private/URLGenerator.php#273
Returns:string base url of the current request