Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #853 from tomcode/hmvc-lite-subfolderDefaultContro…

…ller

Fix for Hmvc lite subfolder default controller handling
  • Loading branch information...
commit a6e16988da80db70ce10afdb599e56e75938bdae 2 parents 772db7b + 0f3d6d1
@narfbg narfbg authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 system/core/Router.php
View
13 system/core/Router.php
@@ -273,9 +273,14 @@ public function validate_route($route)
continue;
}
- // Get class and method
- $class = array_unshift($default);
- $method = array_unshift($default);
+ // Get class and method:
+ // - index 0 and 1 are always present
+ // - since we are in a sub-folder the
+ // first entry is now the directory
+ $directory = array_shift($default);
+ $class = array_shift($default);
+ // the $default route may not have the method set
+ $method = count($default) ? array_shift($default) : 'index';
}
// Does the requested controller exist in the sub-folder?
@@ -534,6 +539,8 @@ public function _set_overrides($routing)
/**
* Get segments of default controller
*
+ * Returns at least two segments
+ *
* @access protected
* @return array array of segments
*/
Please sign in to comment.
Something went wrong with that request. Please try again.