Module

How can i create module within another module using gii or any other method

Please follow the below steps to resolve your issue:

[list=1]

[*]You need to create two modules named "MainModule" and "SubModule" using Gii.

[*]Create a folder named "modules" within the newly created module "MainModule" directory.

[*]Put "SubModule" which was created by Gii, in protected\modules\MainModule\modules directory.

[*]Then register both the modules in protected\config\main.php as below:

[/list]


return array(

                ...

                

                'modules'=>array(

                        'MainModule' => array(

                                'modules' => array(

                                        'SubModule' => array(

                                                'import'=>array('SubModule.*','SubModule.components.*'),

                                                'layout'=>'application.views.layouts.column1',

                                        ),

                                ),

                        ),

                ),


                ...

        );

Let me know if you face any query/concern regarding this.

Thanks,

Saurabh Dhariwal