Skip to content
Permalink
Browse files

Sort routes when scopes are connected.

This solves errors/performance issues when Router::url() is called
before Router::parse().
  • Loading branch information...
markstory committed Jun 29, 2014
1 parent 7ce2f45 commit 982b696be820263b2cc9dd6fa606206ff927f0b8
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Routing/Router.php
@@ -481,7 +481,6 @@ public static function parse($url) {
$url = '/' . $url;
}
krsort(static::$_pathScopes);
foreach (static::$_pathScopes as $path => $collection) {
if (strpos($url, $path) === 0) {
return $collection->parse($url);
@@ -1094,6 +1093,7 @@ public static function scope($path, $params = [], $callback = null) {
if (empty(static::$_pathScopes[$path])) {
static::$_pathScopes[$path] = $collection;
krsort(static::$_pathScopes);
} else {
static::$_pathScopes[$path]->merge($collection);
}

0 comments on commit 982b696

Please sign in to comment.
You can’t perform that action at this time.