Welcome Guest, Not a member yet? Register   Sign In
Default controller problem with controller in a subfolder
#2

[eluser]Pascal Kriete[/eluser]
Yup, I run into this one everytime a project grows large enough to warrant the use of folders. The fix is quite a simple one.

In system/libraries/router.php:
Code:
// function _set_routing

/* .... */

if ($this->default_controller === FALSE)
{
    show_error("Unable to determine what should be displayed. A default route has not been specified in the routing file.");
}

/* Change Start */
            
$parts = explode('/', $this->default_controller);
            
if ( count($parts) > 1)
{
    $this->set_directory( current($parts) );
}
            
$this->set_class( end($parts) );
$this->set_method('index');
$this->_set_request($parts);

/* Change End */

// Re-index the routed segments array so it starts with 1 rather than 0
$this->uri->_reindex_segments();

/* .... */

I've had something like this in my MY_Router file for a while now.


Messages In This Thread
Default controller problem with controller in a subfolder - by El Forum - 06-03-2008, 07:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB