various refactoring and tweaks.
This commit is contained in:
@@ -153,7 +153,10 @@ class Router {
|
||||
foreach (explode(', ', $keys) as $key)
|
||||
{
|
||||
// Append the provided formats to the route as an optional regular expression.
|
||||
if ( ! is_null($formats = $this->provides($callback))) $key .= '(\.('.implode('|', $formats).'))?';
|
||||
if ( ! is_null($formats = $this->provides($callback)))
|
||||
{
|
||||
$key .= '(\.('.implode('|', $formats).'))?';
|
||||
}
|
||||
|
||||
if (preg_match('#^'.$this->wildcards($key).'$#', $destination))
|
||||
{
|
||||
@@ -216,7 +219,9 @@ class Router {
|
||||
{
|
||||
foreach (array_reverse($segments, true) as $key => $value)
|
||||
{
|
||||
if (file_exists($path = $this->controllers.implode('/', array_slice($segments, 0, $key + 1)).EXT))
|
||||
$controller = implode('/', array_slice($segments, 0, $key + 1)).EXT;
|
||||
|
||||
if (file_exists($path = $this->controllers.$controller))
|
||||
{
|
||||
return $key + 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user