Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
767a49f5
Commit
767a49f5
authored
Jul 08, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaking comments in URL class.
parent
60c9c915
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
url.php
system/url.php
+6
-5
No files found.
system/url.php
View file @
767a49f5
...
...
@@ -19,8 +19,8 @@ class URL {
$base
=
Config
::
get
(
'application.url'
);
// Assets live in the public directory,
so we only want to append
// the index file
if the URL is to an asset
.
// Assets live in the public directory,
and should not have
// the index file
appended to their URLs
.
if
(
!
$asset
)
{
$base
.=
'/'
.
Config
::
get
(
'application.index'
);
...
...
@@ -60,6 +60,10 @@ class URL {
/**
* Generate a URL from a route name.
*
* For routes that have wildcard parameters, an array may be passed as the
* second parameter to the method. The values of this array will be used
* to fill the wildcard segments of the route URI.
*
* @param string $name
* @param array $parameters
* @param bool $https
...
...
@@ -69,13 +73,10 @@ class URL {
{
if
(
!
is_null
(
$route
=
Route\Finder
::
find
(
$name
)))
{
// Get the first URI assigned to the route.
$uris
=
explode
(
', '
,
key
(
$route
));
$uri
=
substr
(
$uris
[
0
],
strpos
(
$uris
[
0
],
'/'
));
// Replace any parameters in the URI. This allows the dynamic creation of URLs
// that contain parameter wildcards.
foreach
(
$parameters
as
$parameter
)
{
$uri
=
preg_replace
(
'/\(.+?\)/'
,
$parameter
,
$uri
,
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment