From 23cfea0684d5eb46b4f7313a1aff64d04717a5c4 Mon Sep 17 00:00:00 2001 From: Powlie Date: Mon, 5 Sep 2011 17:44:59 +0200 Subject: [PATCH 1/2] Changed routing to allow for multiple directories to house controllers. --- system/core/Router.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/core/Router.php b/system/core/Router.php index 6da66747267..df9166ad80e 100755 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -280,6 +280,12 @@ function _validate_request($segments) // Set the directory and remove it from the segment array $this->set_directory($segments[0]); $segments = array_slice($segments, 1); + + while(count($segments) > 0 && is_dir(APPPATH.'controllers/'.$this->directory.$segments[0])){ + // Set the directory and remove it from the segment array + $this->set_directory($this->directory . $segments[0]); + $segments = array_slice($segments, 1); + } if (count($segments) > 0) { From e22d9c28f810814bd0e9392f697b54f9a33c9e2e Mon Sep 17 00:00:00 2001 From: Powlie Date: Tue, 6 Sep 2011 10:00:01 +0200 Subject: [PATCH 2/2] Replaced set_directory to allow for '/' in URI request. --- system/core/Router.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/Router.php b/system/core/Router.php index df9166ad80e..f436b98a7ee 100755 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -471,7 +471,7 @@ function fetch_method() */ function set_directory($dir) { - $this->directory = str_replace(array('/', '.'), '', $dir).'/'; + $this->directory = $dir.'/'; } // --------------------------------------------------------------------