1

i have completely done all the task that is Model generator Crud generator after that when there come try the link i click that link it gives the following error

 YiiBase::include(Controller.php) [<a href='function.YiiBase-include'>function.YiiBase-include</a>]: failed to open stream: No such file or directory

i check my model and views folder and it successfully created all the required php pages. can anyone tell me why this error is comming...

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
Fawad Ghafoor
  • 6,039
  • 7
  • 41
  • 53

2 Answers2

2

This is actually due to a documented typo (Controller is missing the extra 'C') in the version of Gii that you are using.

All you have to do is update the controller file it generated from this:

class MyNewController extends Controller
{

to this:

class MyNewController extends CController
{
Jiffy
  • 86
  • 8
2

You need to have a custom Controller class placed in the /protected/controller folder. Extend that class from CController.

class Controller extends CController {

}

you will use later as a base class for your own controller classes.

Pentium10
  • 204,586
  • 122
  • 423
  • 502
  • u mean the default controller i have already class SiteController extends CController {} what i do u want me to rename it ?? – Fawad Ghafoor Jan 06 '12 at 17:45
  • 1
    You need to add another level. `SiteController extends Controller`, and `Controller extends CController`. Than derive all your controllers from `Controller`. – Pentium10 Jan 06 '12 at 21:45