One Module Nested In Another Module. How To Make?

Hi all!

I try to use modules in my project. I can insert one module in my project, but I can’t insert another in my first module.

I try use ‘forum’ module and ‘admin’ module that inside ‘forum’.

My directory structure is that:


protected/

	contollers/

	modules/

		forum/

			ForumModule.php

			controllers/

			modules/

				admin/

					AdminModule.php

					controllers

I don’t understand how to inform Yii about nested ‘admin’ module. I write in ForumModule.php:


class ForumModule extends CWebModule

{

	public $modules = array (


	'modules' => array('admin');


	);

}

And it is not working. Also I have tried:


class ForumModule extends CWebModule

{

	public $modules = array('admin');


}

and it is not working too.

I use routing ?r=forum/admin/site/index and I get error message:

[b]Page Not Found

Unable to resolve the request "forum/admin/site/index".[/b]

I can use ‘forum’ module without problems.

Here I can see it is possible to add nested module in another module.

Where is my mistake?

I have found answer here.

The right code must be in the module class file.


class AdminModule extends CWebModule

{

     public function init()

     {

           ...

           $this->setModules(array('someModule'));

         }

         ...

}