0

I am new to YII framework.I have installed Yii framework and I created one new sample project. by default one sample application is coming. I am trying to add one new page to that site. i have created one new tab in menu. I copied that file to view folder.

when I click that tab in menu I got bellow error.

SiteController cannot find the requested view "adddep". C:\xampp\Yii\framework\web\CController.php(878)

please any one can help me to solve this problem.

Thanks, DHamodhar.E

dhamu
  • 11
  • 1
  • 4

2 Answers2

0

The file adddep.php should be under views/site folder.

redGREENblue
  • 3,076
  • 8
  • 39
  • 57
0

you say copy file to view folder and add a menu tab, you must follow mvc structure,

If you only create view file then you must need to create controller file, its not directly hit view file, first its hit controller file

here some tutorial link: http://www.yiiframework.com/screencasts/ http://www.yiiframework.com/tutorials/

  • Thanks for giving replay. I have write some code in SiteController.php like bellow – dhamu Oct 25 '13 at 12:49
  • if you write some code in SiteController.php then view file must go this location views/site/adddep.php. suppose your view file is here views/site/adddep.php then your SiteController.php code like this: public function actionAdddep() { $this->render('adddep'); } I think now you can solve your problem @dhamu – Zahangir Alam Oct 26 '13 at 09:08