Answer the question
In order to leave comments, you need to log in
Why can't the controller find the "index" view?
Please tell me how is it right?
Everything is as in the "manual" - in the Controllers folder I created StatisticController.php in which I created an instance of the class:
<?php
class StatisticController extends Controller
{
public function actionIndex()
{
$this->render('index');
}
}
<h1>TEST</h1>
{
870 if(($viewFile=$this->getViewFile($view))!==false)
871 {
872 $output=$this->renderFile($viewFile,$data,true);
873 if($processOutput)
874 $output=$this->processOutput($output);
875 if($return)
876 return $output;
877 else
878 echo $output;
879 }
880 else
881 throw new CException(Yii::t('yii','{controller} cannot find the requested view "{view}".',
882 array('{controller}'=>get_class($this), '{view}'=>$view)));
883 }
#1
– /var/www/html/protected/controllers/StatisticController.php(7): CController->render("index")
2
3 class StatisticController extends Controller
4 {
5 public function actionIndex()
6 {
7 $this->render('index');
8 }
9 }
#9
– /var/www/html/index.php(39): CApplication->run()
34 ini_set('display_errors', 'Off');
35 error_reporting(0);
36 }
37
38 require_once($yii);
39 Yii::createWebApplication($config)->run();
40
41 //echo phpinfo();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question