Yii Working With Databases :importing Classes.

I’m new to yii and I came across this statement .


Tip: Because AR classes are often referenced in many places, we can import the whole directory containing the AR class, instead of including them one by one. For example, if all our AR class files are under protected/models, we can configure the application as follows:

return array(





my question is, what if I want to import all the models in my modules.

for example, I have 2 modules in



how do I set that up in the autoloading section in main.php.

Thank you

write a file named test1Module.php under modules/test1

test1Module.php code:


class HoutaiModule extends CWebModule 


	public function init()






	public function beforeControllerAction($controller,$action)




			return true;



			return false;	



very good , thank you!