Welcome Guest, Not a member yet? Register   Sign In
Default Controller Issue
#4

[eluser]mddd[/eluser]
If you remove all your routes except the default controller route,
then it should work like this:

/ -> page controller. index method. default $page: register
/somecontroller -> goes to that controller
/page/somevalue -> page controller. somevalue method (if it exists). otherwise: 404 error.
/page/index -> page controller. index method. default $page: register
/page/index/somevalue -> page controller. index method. $page: somevalue

If you want this:
/page/somevalue -> page controller. index method. $page: somevalue
then you must use the _remap method in the page controller. this takes care of any method calls to methods
that don't exist:

Code:
function _remap($vars)
{
   $this->index($vars);
}
This will send ALL calls to the page controller through _remap, and _remap sends them on to index, along with the values from the requested url.
So /page/somevalue goes to _remap('somevalue') and that goes on to index('somevalue').


Messages In This Thread
Default Controller Issue - by El Forum - 04-14-2010, 08:14 AM
Default Controller Issue - by El Forum - 04-14-2010, 08:41 AM
Default Controller Issue - by El Forum - 04-14-2010, 08:43 AM
Default Controller Issue - by El Forum - 04-14-2010, 08:54 AM
Default Controller Issue - by El Forum - 04-14-2010, 09:00 AM
Default Controller Issue - by El Forum - 04-14-2010, 09:07 AM
Default Controller Issue - by El Forum - 06-28-2010, 03:07 AM
Default Controller Issue - by El Forum - 06-29-2010, 06:56 AM
Default Controller Issue - by El Forum - 06-29-2010, 04:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB