summaryrefslogtreecommitdiffstats
path: root/system/core/Router.php
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-08-11 02:41:10 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-08-11 02:41:10 +0200
commitd33f91708f73735231f458090a478f1204480c30 (patch)
treeae56861471ef4a26e8cc062eae2ad539d262d667 /system/core/Router.php
parent03a9599befa5c8967f70960eda40b5f2a65f75cb (diff)
parent6adfe636980da3a7b25e5b87ed8bcd1d008a1243 (diff)
Merge pull request #38 from bubbafoley/develop
404_override route now works for missing controllers in subdirectories.
Diffstat (limited to 'system/core/Router.php')
-rw-r--r--system/core/Router.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/system/core/Router.php b/system/core/Router.php
index 5e92a04b1..668ac0954 100644
--- a/system/core/Router.php
+++ b/system/core/Router.php
@@ -244,7 +244,20 @@ class CI_Router {
// Does the requested controller exist in the sub-folder?
if ( ! file_exists(APPPATH.'controllers/'.$this->fetch_directory().$segments[0].'.php'))
{
- show_404($this->fetch_directory().$segments[0]);
+ if ( ! empty($this->routes['404_override']))
+ {
+ $x = explode('/', $this->routes['404_override']);
+
+ $this->set_directory('');
+ $this->set_class($x[0]);
+ $this->set_method(isset($x[1]) ? $x[1] : 'index');
+
+ return $x;
+ }
+ else
+ {
+ show_404($this->fetch_directory().$segments[0]);
+ }
}
}
else