Yii Working With Databases :importing Classes.

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

http://www.yiiframework.com/doc/guide/1.1/en/database.ar

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(

  'import'=>array(

      'application.models.*',

  ),

);

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

for example, I have 2 modules in

Application.modules.test1

Application.modules.test2

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:


<?php

class HoutaiModule extends CWebModule 

{

	public function init()

	{

		$this->setImport(array(

			'houtai.models.*',

			'houtai.components.*',

		));

	public function beforeControllerAction($controller,$action)

	{

		if(parent::beforeControllerAction($controller,$action))

		{

			return true;

		}

		else 

			return false;	

	}

}

very good , thank you!