Commit b55e5169 authored by Taylor Otwell's avatar Taylor Otwell

adjusted comments in route loader.

parent f9f168ea
...@@ -25,9 +25,6 @@ class Loader { ...@@ -25,9 +25,6 @@ class Loader {
/** /**
* Load the appropriate routes from the routes directory. * Load the appropriate routes from the routes directory.
* *
* This is done by working down the URI until we find the deepest
* possible matching route file.
*
* @param string $uri * @param string $uri
* @return array * @return array
*/ */
...@@ -35,6 +32,8 @@ class Loader { ...@@ -35,6 +32,8 @@ class Loader {
{ {
$segments = explode('/', $uri); $segments = explode('/', $uri);
// Work backwards through the URI segments until we find the deepest possible
// matching route file in the routes directory.
foreach (array_reverse($segments, true) as $key => $value) foreach (array_reverse($segments, true) as $key => $value)
{ {
if (file_exists($path = ROUTE_PATH.implode('/', array_slice($segments, 0, $key + 1)).EXT)) if (file_exists($path = ROUTE_PATH.implode('/', array_slice($segments, 0, $key + 1)).EXT))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment