xx666xx
(Jerryablan)
November 19, 2009, 5:09pm
1
I found an old post from 2008 regarding this but I can’t seem to get it to work.
I have the following:
/controllers
AdminController.php
OtherController.php
/view
/admin
/other
If I call /admin/other/action I get action not found.
Do I need to set up an urlManager mapping for this or is it automatic? I’m kind of lost and need to make this work or restructure my application.
Any help would be appreciated.
– Jerry
notzippy
(Notzippy)
November 19, 2009, 5:44pm
2
With the request of admin/other/action the yii would expect to find a module named admin and the controller to be within it. Is this what you wanted ?
http://www.yiiframework.com/doc/guide/basics.module
nz
xx666xx
(Jerryablan)
November 19, 2009, 6:07pm
3
No, I guess what I want is for the framework to look for a controller when an action is not found.
/admin/create calls /controllers/AdminController::actionCreate()
/admin/import/create calls /controllers/admin/ImportController::create (or /controllers/ImportCont…
Nested controllers basically. But this will probably screw up the missingAction mechanism so it probably isn’t possible. I’ll just have to move to a module.
notzippy
(Notzippy)
November 19, 2009, 7:10pm
4
Another alternative is to define an Action see :
http://www.yiiframework.com/doc/guide/basics.controller
Not sure what you need this for so I cannot recommend which is best approach for you…
nz
xx666xx
(Jerryablan)
November 20, 2009, 4:23am
5
You know, as it turned out, I should have been using a module all along. I’ve refactored and it’s all good now. Thanks to all.