setModules at start

I’m trying to set the modules in init of the basecontroller instead of main.php but I still get a 404 error when I try to access the module.




		Yii::app()->setModules(array(

			'mymodule1',

			'mymodule2',

		));



Any idea how I can do that ?

The basecontroller is too late in the process. I think you can use the onBeginRequest event.

Read more here.

/Tommy

Thanks. How can I catch this CApplication event ?