Welcome Guest, Not a member yet? Register   Sign In
default_controller routing with varibles broken
#1
Bug 

The issue i've got is the $route['default_controller'] is erroring out when including a controller/method/variable.

It works fine when there is only a controller/method defined as the default_controller, but it doesn't work as documented or as it did in CI2 (latest stable) which I am porting my code over from.

After some initial research and debugging of the system/core/Router.php class shows that the constructor calls a number of functions which decorate and clean the route, but when it hits the _set_default_controller() method after this process the output from the stored class parameter is:

Assumed: class/method

When using a route like this:

$route['default_controller'] = "home/index/1";

The output of the $this->default_controller is then:

1/index

This is unexpected and a rather odd way to restructure the segments, I have tried to resolve this, but I don't know enough about the Routing flow, from looking through the other methods it doens't look like CI3 stores the variables for URL's within the segment array.

This method looks like it has been drastically re-written since CI2 and now doesn't work as per CI v2 or the documentation for the routing class. I have been an avid user of CI for years now and haven't seen any major issues like this, the crux of my application relies on this due to caching routes and auto-generating a file which contain cached routes to eliminate hitting the database everytime to validate a dynamic route and serve the page. Due to this re-write I'm un-able to to use the functionality as expected and any route should allow controller/method/variable be it set or dynamic.

Any help would be appreciated as I'm nearly finished on a job upgrading a previous system (with a client pressing for a release) and un-able to finish this due to the functionality here not behaving as expected.

Many thanks
Steve
Reply


Messages In This Thread
default_controller routing with varibles broken - by weblogics - 06-12-2015, 06:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB