URLGenerator

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

Properties

Methods

public OC\URLGenerator::__construct($config, $cacheFactory, $request)
Source:

lib/private/URLGenerator.php#61

Parameters:
public OC\URLGenerator::linkToRoute($route, $parameters=array())
Creates an url using a defined route
Source:

lib/private/URLGenerator.php#77

Parameters:
  • $route (string)
  • $parameters (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=array())
Creates an absolute url using a defined route
Source:

lib/private/URLGenerator.php#90

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#94
public OC\URLGenerator::linkTo($app, $file, $args=array())
Creates an url
Source:

lib/private/URLGenerator.php#117

Parameters:
  • $app (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($app, $image)
Creates path to an image
Source:

lib/private/URLGenerator.php#165

Parameters:
  • $app (string) app
  • $image (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#239

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#257

Parameters:
  • $key (string)
Returns:

string url to the online documentation

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