Class 'Controller' not found in C: \ xampp \ htdocs \ mysite \ protected \ controllers \ AppsinfoController.php on line 4

points to this:

> class AppsinfoController extends Controller > { > public function actionIndex() > { > $this->render('index'); > } > public function loadModel($id) > { > $model=TAppsInfo::model()->findByPk($id); > if($model===null) > throw new CHttpException(404,'The requested page > does not exist.'); > return $model; > } > } 

What could be the reasons?

Comments are over writing here: TAppsInfo.php

    1 answer 1

    prescribe

     CController // а не Controller 
    • it is necessary to do all this in each controller, advice to make the basic controller

    like

      class СController extends Controller { $layout='//bla'; $menu=array(); $breadcrumbs=array(); } 

    and use it everywhere.

    // upd ok. Try it.

     public function loadModel($id) { $model=TAppsШтащ::model()->findByPk($id); // что за русский язык? if($model===null) throw new CHttpException(404,'The requested page does not exist.'); return $model; } } 

    And why do you have the first letter there T in the model really have the letter T or did you just write it off here?

    Here the option is what. It is possible that the model is named TAppsInfo and the file is wrong, i.e. can appsInfo look at how the model is named and which file.

    // upd

    Ok believe what's there

    TAppsInfo TAppsImg TApps

    Other controls with other models normally load?

    • are the models loaded in the config? - Artem
    • Try it and re-generate crud for this control - Artem
    • generated and even the controller rewrote using crud, nothing ( - LIVE
    • all, it's time to Durkee. The day was tormented and tormented you, and the error in the config was sealed in one line in the connection of the module that accesses this model. Thanks for the help - I live