0
votes

I yii beginner, I change the default controller from main.php in config and create new controller as follow,

 class HomeController extends CController
{
    public function actionIndex()
    {
        $this->render('newindex');
    }
}

newindex view is in site folder in view. But when i run this, its giving error HomeController cannot find the requested view "newindex". Please help me

1

1 Answers

1
votes

Do like below:

$this->render('//site/newindex');  //means views/site/newIndex.php

// refers to Views path. But when you say $this->render('newIndex') yii looks for newIndex file in views/home/newIndex which is given from controller name.