steven_He
(steven He)
March 24, 2011, 5:11am
1
Hei guys, I got a very annoying problem here.
1400
error.tiff
When SiteController extends from [color="#FF0000 "]Controller[/color], it seems Yii couldn’t load Controller.php
However, if I make SiteController extends from [color="#FF0000 "]CController[/color], everything works fine.
Anyone has any idea please?
prozn7
(Verge Gfx)
March 24, 2011, 5:21am
2
CController is one of the framework classes while Controller is not.
Do you have a Controller.php file in your application? If yes, did you import it?
It is very weird as Yii takes care of it by default including Controller.php on your components folder and configure the main.php file accordingly to import it. Check your config file and make sure Controller.php is in its corresponding location.
main.php under protected/config folder
// autoloading model and component classes
'import'=>array(
'application.models.*',
'application.components.*',
),
mdomba
(Maurizio Domba Cerin)
March 24, 2011, 8:28am
4
Note that controller.php is generated by yiic when creating a new webapp, it’s located at /protected/components - http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app
If you started to code your app manually then you don’t have this file
steven_He
(steven He)
March 25, 2011, 12:12am
5
Yes, you’re right. I started this new project manually and I forgot to create the Controller.php
Thanks mate.
steven_He
(steven He)
March 25, 2011, 12:14am
6
CController is one of the framework classes while Controller is not.
Do you have a Controller.php file in your application? If yes, did you import it?
Right, I forgot to create Controller.php. Coz I created this new project manually … Thanks man