added support for nested route directories.

This commit is contained in:
Taylor Otwell 2011-07-18 22:21:07 -05:00
parent 109a7b4baa
commit 88276ba79e
1 changed files with 9 additions and 1 deletions

View File

@ -73,7 +73,15 @@ private static function load_from_directory($uri)
{
$segments = explode('/', $uri);
return (file_exists($path = APP_PATH.'routes/'.$segments[0].EXT)) ? require $path : array();
foreach (array_reverse($segments, true) as $key => $value)
{
if (file_exists($path = APP_PATH.'routes/'.implode('/', array_slice($segments, 0, $key + 1)).EXT))
{
return require $path;
}
}
return array();
}
/**