How To Access A Model In A Module From Sitecontroller

Hi All,

I have a module and in the default action index in SiteController I would like to retrieve information from a model currently located in a module, I just can’t do it! Yii is trying to look for the model file into protected/models folders, any idea?


You just have to "import" the model classes in your module.


// or

// Yii::import('application.modules.mymodule.models.*');


$model = new MyModel();

You may import them in "config/main.php" if you need them regularly.







Oh God… What stupid question I made! I forgot that! Thanks softark!