Model Folder

If this has been asked before i’m sorry I looked could not find it.

I’m using yiic to to generate my models for my database tables. What I would like to have it do is send the models it makes to models/database/whatevertable.php just for neatness can this be done?

Thanks,

John

In your case the command would be

>>model application.models.database.whatevertable

or

>>model application.models.database.*

/Tommy

Worked perfectly ty.

Ok well maybe not. It loads the model in the right folder but the program can not find it. I assume I need to point it but how.

Add your directory alias to the import array in the config file

Yes, it must be in the config’s import section: ‘application.models.database.*’.

Or anywhere else you should put Yii::import(‘application.models.database.*’) or Yii::import(‘application.models.database.modelName’) for a specific model.

much better thanks all.