diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-09-08 14:43:14 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-09-08 14:43:14 +0200 |
commit | c5b53785583eb215eb1ec889333ecf25ecb97e66 (patch) | |
tree | 142d208a6260ccba4c1996fe76751e16cde9117a /lib/private/urlgenerator.php | |
parent | 637cff68ac2944d6029eb015640bbbd0e686641b (diff) | |
download | nextcloud-server-c5b53785583eb215eb1ec889333ecf25ecb97e66.tar.gz nextcloud-server-c5b53785583eb215eb1ec889333ecf25ecb97e66.zip |
Add a method to get the absolute url for a route
Fix #10926
Diffstat (limited to 'lib/private/urlgenerator.php')
-rw-r--r-- | lib/private/urlgenerator.php | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/urlgenerator.php b/lib/private/urlgenerator.php index af5d977eeab..f5ec9803edb 100644 --- a/lib/private/urlgenerator.php +++ b/lib/private/urlgenerator.php @@ -35,7 +35,7 @@ class URLGenerator implements IURLGenerator { * @internal param array $args with param=>value, will be appended to the returned url * @return string the url * - * Returns a url to the given app and file. + * Returns a url to the given route. */ public function linkToRoute($route, $parameters = array()) { $urlLinkTo = \OC::$server->getRouter()->generate($route, $parameters); @@ -43,6 +43,19 @@ class URLGenerator implements IURLGenerator { } /** + * Creates an absolute url using a defined route + * @param string $route + * @param array $parameters + * @internal param array $args with param=>value, will be appended to the returned url + * @return string the url + * + * Returns an absolute url to the given route. + */ + public function linkToRouteAbsolute($routeName, $arguments = array()) { + return $this->getAbsoluteURL($this->linkToRoute($routeName, $arguments)); + } + + /** * Creates an url * @param string $app app * @param string $file file |