added comment regarding nested route directories.
This commit is contained in:
parent
5b86ad6067
commit
fb8eb874c0
|
@ -73,6 +73,9 @@ private static function load_from_directory($uri)
|
||||||
{
|
{
|
||||||
$segments = explode('/', $uri);
|
$segments = explode('/', $uri);
|
||||||
|
|
||||||
|
// Route files can be nested deep within sub-directories. To find the
|
||||||
|
// appropriate file, we work our way backward through the URI looking
|
||||||
|
// for the deepest matching file.
|
||||||
foreach (array_reverse($segments, true) as $key => $value)
|
foreach (array_reverse($segments, true) as $key => $value)
|
||||||
{
|
{
|
||||||
if (file_exists($path = APP_PATH.'routes/'.implode('/', array_slice($segments, 0, $key + 1)).EXT))
|
if (file_exists($path = APP_PATH.'routes/'.implode('/', array_slice($segments, 0, $key + 1)).EXT))
|
||||||
|
|
Loading…
Reference in New Issue