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
eb193c1d
Commit
eb193c1d
authored
Jan 18, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
working on the route class.
parent
bfc04e28
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
6 deletions
+3
-6
route.php
laravel/routing/route.php
+1
-1
router.php
laravel/routing/router.php
+0
-4
route.test.php
tests/cases/laravel/route.test.php
+2
-1
No files found.
laravel/routing/route.php
View file @
eb193c1d
...
@@ -58,7 +58,7 @@ class Route {
...
@@ -58,7 +58,7 @@ class Route {
// Extract each URI from the route key. Since the route key has the request
// Extract each URI from the route key. Since the route key has the request
// method, we will extract that from the string. If the URI points to the
// method, we will extract that from the string. If the URI points to the
// root of the application, a single forward slash will be returned.
// root of the application, a single forward slash will be returned.
$uris
=
array_get
(
$action
,
'handles'
,
array
());
$uris
=
array_get
(
$action
,
'handles'
,
array
(
$key
));
$this
->
uris
=
array_map
(
array
(
$this
,
'extract'
),
$uris
);
$this
->
uris
=
array_map
(
array
(
$this
,
'extract'
),
$uris
);
...
...
laravel/routing/router.php
View file @
eb193c1d
...
@@ -200,8 +200,6 @@ class Router {
...
@@ -200,8 +200,6 @@ class Router {
$action
=
array
(
'uses'
=>
Bundle
::
prefix
(
$bundle
)
.
'home@index'
);
$action
=
array
(
'uses'
=>
Bundle
::
prefix
(
$bundle
)
.
'home@index'
);
$action
[
'handles'
]
=
array
(
$destination
);
return
new
Route
(
$method
.
' '
.
$uri
,
$action
);
return
new
Route
(
$method
.
' '
.
$uri
,
$action
);
}
}
...
@@ -245,8 +243,6 @@ class Router {
...
@@ -245,8 +243,6 @@ class Router {
$action
=
array
(
'uses'
=>
$prefix
.
$controller
.
'@'
.
$method
);
$action
=
array
(
'uses'
=>
$prefix
.
$controller
.
'@'
.
$method
);
$action
[
'handles'
]
=
array
(
$destination
);
return
new
Route
(
$destination
,
$action
,
$segments
);
return
new
Route
(
$destination
,
$action
,
$segments
);
}
}
}
}
...
...
tests/cases/laravel/route.test.php
View file @
eb193c1d
...
@@ -19,9 +19,10 @@ class RouteTest extends PHPUnit_Framework_TestCase {
...
@@ -19,9 +19,10 @@ class RouteTest extends PHPUnit_Framework_TestCase {
{
{
$route
=
new
Laravel\Routing\Route
(
'GET /'
,
array
(
'handles'
=>
array
(
'GET /foo/bar'
)));
$route
=
new
Laravel\Routing\Route
(
'GET /'
,
array
(
'handles'
=>
array
(
'GET /foo/bar'
)));
$this
->
assertFalse
(
$route
->
handles
(
'/'
));
$this
->
assertFalse
(
$route
->
handles
(
'baz'
));
$this
->
assertTrue
(
$route
->
handles
(
'foo/*'
));
$this
->
assertTrue
(
$route
->
handles
(
'foo/*'
));
$this
->
assertTrue
(
$route
->
handles
(
'foo/bar'
));
$this
->
assertTrue
(
$route
->
handles
(
'foo/bar'
));
$this
->
assertFalse
(
$route
->
handles
(
'baz'
));
$route
=
new
Laravel\Routing\Route
(
'GET /'
,
array
(
'handles'
=>
array
(
'GET /'
,
'GET /home'
)));
$route
=
new
Laravel\Routing\Route
(
'GET /'
,
array
(
'handles'
=>
array
(
'GET /'
,
'GET /home'
)));
...
...
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