mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
Merge pull request #79 from skipperbent/development
[BUGFIX] Bugfixes and optimisations
This commit is contained in:
@@ -135,6 +135,14 @@ class RouterBase {
|
||||
|
||||
$routeNotAllowed = false;
|
||||
|
||||
// Make sure routes with longer urls are rendered first
|
||||
usort($this->controllerUrlMap, function($a, $b) {
|
||||
if(strlen($a->getUrl()) < strlen($b->getUrl())) {
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
});
|
||||
|
||||
$max = count($this->controllerUrlMap);
|
||||
|
||||
/* @var $route RouterEntry */
|
||||
|
||||
@@ -93,7 +93,7 @@ class RouterGroup extends RouterEntry {
|
||||
* @return self
|
||||
*/
|
||||
public function addSettings(array $settings = null) {
|
||||
if(isset($settings['namespace'])) {
|
||||
if($this->getNamespace() !== null && isset($settings['namespace'])) {
|
||||
unset($settings['namespace']);
|
||||
}
|
||||
if(is_array($settings)) {
|
||||
|
||||
Reference in New Issue
Block a user