bug in CActiceDataProvider

Hi all,

I’ve got an Users model.

In my “admin” controller I’ve got an “admin” action with the following code:


        $dataProvider=new CActiveDataProvider('Users', array(

            'pagination'=>array(

                'pageSize'=>Yii::app()->controller->module->user_page_size,

            ),

this raise that error:


include(User.php): failed to open stream: No such file or directory

All other action in that controller works well, like:


    public function loadModel()

    {

        if($this->_model===null)

        {

            if(isset($_GET['id']))

                $this->_model=Users::model()->notsafe()->findbyPk($_GET['id']);

            if($this->_model===null)

                throw new CHttpException(404,'The requested page does not exist.');

        }

        return $this->_model;

    }




Any idea ?

Thanks for your help?

Are you shure that you have tiped the correct model name in you controller?

Error says ‘User’ but your model si ‘Users’.

Yes, Users is the model name and he’s used in other actions of the same controller (and also in other controllers) …

What’s the rest of the error? It’s looking for User.php somewhere… and if the file of your model is Users.php and the class name is Users… something else is calling User.php somewhere.

Thanks for your suggestion, it helped me a lot.

Error was in the view, in ‘zii.widgets.grid.CGridView’ where User model was called and not Users …

Thanks all