Rahul Thakur
Rahul Thakur

Reputation: 821

Yii not able to load models from generated modules

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

Upvotes: 0

Views: 54

Answers (1)

Manquer
Manquer

Reputation: 7647

You need to adjust your config/main file to include the models from your new module with something like this

.....
'import' => array(
    application.modules.calendar.models.*
 ),

Upvotes: 1

Related Questions