[eluser]BrianDHall[/eluser]
[quote author="Michel-Ange" date="1258395965"]The only CI hack is in CodeIgniter.php :
Code:
// Load the local application controller
// Note: The Router class automatically validates the controller path. If this include fails it
// means that the default controller in the Routes.php file is not resolving to something valid.
/*
if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT))
{
show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.');
}
include(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT);
*/
/**
* Begin addition
* Purpose: Enable Controller cascading
*/
if( ! $RTR->fetch_controller_path())
{
show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.');
}
include($RTR->fetch_controller_path());
/*
* End Addition
*/
If you have another idea, I'm open to well coded suggestions ![/quote]
I believe I have a solution!
First, change the core file back to the way it was - uncomment the original code, and comment out the addition.
Then in application/libraries/Router.php, add a new function:
Code:
public function fetch_directory()
{
$folders = explode('/',APPPATH);
That's it! The trick is using ../ in paths. So first we reverse the effect that APPPATH/controllers has in CodeIgniter.php, then we proceed as normal. No other changes needed!
To start with, everything works perfectly.
EDIT: I had some other problems that were my own darn fault, had an old CI install on this one.