Welcome Guest, Not a member yet? Register   Sign In
User Profile URL
#11

[eluser]Pygon[/eluser]
I'd prefer something like this:

Code:
class MY_Router extends CI_Router {

    function MY_Router()
    {
        parent::CI_Router();
    }

    function _validate_request($segments)
    {
        // If the controller doesn't exist...
        if (!file_exists(APPPATH.'controllers/'.$segments[0].EXT))
        {
            //Automagically route the request to the user/display controller
            return array_merge(array("user","display"),$segments);
            
        } else {
            parent::_validate_request($segments);
        }
    }

}


Messages In This Thread
User Profile URL - by El Forum - 03-01-2008, 12:38 AM
User Profile URL - by El Forum - 03-01-2008, 01:20 AM
User Profile URL - by El Forum - 03-01-2008, 02:34 AM
User Profile URL - by El Forum - 03-01-2008, 02:53 AM
User Profile URL - by El Forum - 03-01-2008, 03:10 AM
User Profile URL - by El Forum - 03-01-2008, 03:18 AM
User Profile URL - by El Forum - 03-01-2008, 03:23 AM
User Profile URL - by El Forum - 03-01-2008, 04:05 AM
User Profile URL - by El Forum - 03-01-2008, 01:54 PM
User Profile URL - by El Forum - 03-03-2008, 08:13 AM
User Profile URL - by El Forum - 03-03-2008, 11:13 AM
User Profile URL - by El Forum - 03-03-2008, 03:04 PM
User Profile URL - by El Forum - 03-03-2008, 03:28 PM
User Profile URL - by El Forum - 03-03-2008, 03:32 PM
User Profile URL - by El Forum - 03-03-2008, 03:58 PM
User Profile URL - by El Forum - 03-03-2008, 07:53 PM
User Profile URL - by El Forum - 03-04-2008, 09:52 AM
User Profile URL - by El Forum - 03-04-2008, 10:07 AM
User Profile URL - by El Forum - 05-04-2008, 06:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB