Yii Not Able To Load Models From Generated Modules

Hi, I have created a ‘calendar’ module. Then created a model for ‘Events’ and also generated the files for crud operations. But when i copied it to their respective directories in ‘calendar’ module, it is not working as Yii is not able to find the model class ‘Events’. Though when I place ‘Events’ model file into the main ‘models’ directory it starts working. What could be wrong?

The problem was that I had not included

‘import’ => array (




in my main configuration file.

Yes, but you only include them there when you need the models available outside your module too. Normally you would add them to the setImport() function of the module class.