user3287504
user3287504

Reputation:

Yii nested module settings

I need to create multiple application using yii and it seems that modules is my best solution, because I don't want to copy paste components, extension on other yii project.

My project consist of client, applicant, admin and they all have different functionalities inside my application

I tried this structure in Yii

modules
 -> client
     -> modules
          -> module1
          -> module2
 -> applicant
     -> modules
          -> module1
          -> module2
 -> admin
     -> controllers
          -> site
     -> modules
          -> module1
          -> module2
          -> module3

but when I called domain.com/admin/module1/default/index it says 404 error even I have default controller and index view on my source,

I tried domain.com/admin/site/login it works fine, is there something I missing here....

here's my config for modules

'modules'=>array(
        'admin' => array(
            'modules' => array(
                'user'

            )
        )
    ),

Upvotes: 0

Views: 416

Answers (1)

Cherif BOUCHELAGHEM
Cherif BOUCHELAGHEM

Reputation: 1136

You need to specify the nested module alias path :

'modules'=>array(
        'admin' => array(
            'modules' => array(
                'user'=>array(
                   'class'=>'application.modules.user.UserModule' //just an example put yours
                    'components'=>array(), 
                 )

            )
        )
    ),

You can also configure that in the module class init method just use setModules()

Upvotes: 1

Related Questions