| @@ 440-445 (lines=6) @@ | ||
| 437 | ||
| 438 | if (empty(static::$optimized_tree)) { |
|
| 439 | foreach ((array)static::$routes as $group => $routes){ |
|
| 440 | foreach ($routes as $route) { |
|
| 441 | if (is_a($route, 'Route') && false !== ($args = $route->match($URL,$method))){ |
|
| 442 | $route->run($args,$method); |
|
| 443 | return true; |
|
| 444 | } |
|
| 445 | } |
|
| 446 | } |
|
| 447 | } else { |
|
| 448 | ||
| @@ 453-458 (lines=6) @@ | ||
| 450 | foreach (explode('/',trim($URL,'/')) as $segment) { |
|
| 451 | if (isset($branch[$segment])) $branch =& $branch[$segment]; |
|
| 452 | } |
|
| 453 | if (is_array($branch)) foreach ($branch as $route) { |
|
| 454 | if (is_a($route, 'Route') && false !== ($args = $route->match($URL,$method))){ |
|
| 455 | $route->run($args, $method); |
|
| 456 | return true; |
|
| 457 | } |
|
| 458 | } |
|
| 459 | ||
| 460 | } |
|
| 461 | ||