How to access subcontroller/view

Hi.

I’ve created CRUD operations that is located within another controller and can’t figure out how to access them.

I want to have a main controller “user” and sub controllers like “profile” or “settings” alle with CRUD etc. resulting in URL’s like:

user/create

user/update/12

user/profile/view

user/settings/update/123

The controllers and views are located in subfolders like views/user/settings but how can I access them?

I figure that have have to change my urlManager settings?:




'urlManager'=>array(

    'urlFormat'=>'path',

    'showScriptName'=>false,

    'rules'=>array(

        '' => 'signup/index',

        '<controller:\w+>/<id:\d+>'=>'<controller>/view',

        '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',

        '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

    ),

),



Thanks a lot! :)

I don’t think Yii supports sub controllers. Have you tried modules?

Take a look at the yii-user module. There are no "subcontrollers" in Yii, but there are modules and submodules.

Ok, thanks!