Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
c5b53785
Commit
c5b53785
authored
10 years ago
by
Joas Schilling
Browse files
Options
Downloads
Patches
Plain Diff
Add a method to get the absolute url for a route
Fix #10926
parent
637cff68
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/private/urlgenerator.php
+14
-1
14 additions, 1 deletion
lib/private/urlgenerator.php
lib/public/iurlgenerator.php
+8
-0
8 additions, 0 deletions
lib/public/iurlgenerator.php
with
22 additions
and
1 deletion
lib/private/urlgenerator.php
+
14
−
1
View file @
c5b53785
...
...
@@ -35,13 +35,26 @@ 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 fil
e.
* Returns a url to the given
rout
e.
*/
public
function
linkToRoute
(
$route
,
$parameters
=
array
())
{
$urlLinkTo
=
\OC
::
$server
->
getRouter
()
->
generate
(
$route
,
$parameters
);
return
$urlLinkTo
;
}
/**
* 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
...
...
This diff is collapsed.
Click to expand it.
lib/public/iurlgenerator.php
+
8
−
0
View file @
c5b53785
...
...
@@ -42,6 +42,14 @@ interface IURLGenerator {
*/
public
function
linkToRoute
(
$routeName
,
$arguments
=
array
());
/**
* Returns the absolute URL for a route
* @param string $routeName the name of the route
* @param array $arguments an array with arguments which will be filled into the url
* @return string the absolute url
*/
public
function
linkToRouteAbsolute
(
$routeName
,
$arguments
=
array
());
/**
* Returns an URL for an image or file
* @param string $appName the name of the app
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment