Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
Details
Activity
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
ce5a922b
Commit
ce5a922b
authored
Feb 04, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleaning up the uri method.
parent
f3be544b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
11 deletions
+16
-11
laravel/uri.php
+16
-11
No files found.
laravel/uri.php
View file @
ce5a922b
...
...
@@ -33,22 +33,14 @@ class URI {
$uri
=
static
::
remove
(
$uri
,
parse_url
(
URL
::
base
(),
PHP_URL_PATH
));
// We'll also remove the application's index page as it is not used for at
// all for routing and is totally unnecessary as far as the
framework is
//
concerned. It is only in the URI when mod_rewrite is not available
.
// all for routing and is totally unnecessary as far as the
routing of
//
incoming requests to the framework is concerned
.
if
((
$index
=
'/'
.
Config
::
get
(
'application.index'
))
!==
'/'
)
{
$uri
=
static
::
remove
(
$uri
,
$index
);
}
static
::
$uri
=
static
::
format
(
$uri
);
// Cache the URI segments. This allows us to avoid having to explode
// the segments every time the developer requests one of them. The
// extra slashes have already been stripped off of the URI so no
// extraneous elements should be present in the segment array.
$segments
=
explode
(
'/'
,
trim
(
static
::
$uri
,
'/'
));
static
::
$segments
=
array_diff
(
$segments
,
array
(
''
));
static
::
segments
(
static
::
$uri
=
static
::
format
(
$uri
));
return
static
::
$uri
;
}
...
...
@@ -76,6 +68,19 @@ class URI {
}
/**
* Set the URI segments for the request.
*
* @param string $uri
* @return void
*/
protected
function
segments
(
$uri
)
{
$segments
=
explode
(
'/'
,
trim
(
$uri
,
'/'
));
static
::
$segments
=
array_diff
(
$segments
,
array
(
''
));
}
/**
* Remove a given value from the URI.
*
* @param string $uri
...
...
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