[RESOLVED] Nested controllers, how?

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

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

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.

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

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.