BUG CViewAction and wrong described documentation

property requestedView controller and id property read-only - it canot be defined,

property view is predefined (it can`t be defined because)




public function run()

        {

                $this->resolveView($this->getRequestedView());



EDIT




public function getRequestedView()

        {

                if($this->_viewPath===null)

                {

                        if(!empty($_GET[$this->viewParam]))

                                $this->_viewPath=$_GET[$this->viewParam];

                        else

                                $this->_viewPath=$this->defaultView;

                }

                return $this->_viewPath;

        }


        protected function resolveView($viewPath)

        {


                if(preg_match('/^\w[\w\.\-]*$/',$viewPath))

                {

                        $view=strtr($viewPath,'.','/');

                        if(!empty($this->basePath))

                                $view=$this->basePath.'/'.$view;

                        if($this->getController()->getViewFile($view)!==false)

                        {

                                $this->view=$view;

                                return;

                        }

                }

                throw new CHttpException(404,Yii::t('yii','The requested view "{name}" was not found.',

                        array('{name}'=>$viewPath)));

        }






public $view is actually public $defaultView => that is bug

if $viewParam is defined that becomes view => that is bug

iv`e tested all

I didnt quite understand what you mean by bugged

do you want to set a different view path ? you can do that

case one





'testaction'=>array(

'class'=>'CViewAction',

'basePath'=>'application.views.site',

'viewParam'=>'id',

'defaultView'=>'index',

'view'=>'findme',

)



but view findme.php in site folder exist because is predefined

link = site/testaction?id=1

says index.php dosen`t exist if the get variable not found the view will be defaultView index.php in this case im searching for findme.php

view dosent exist, work only if default view is findme , not meter if view is defined it can`t be defined because is predefined in $this->resolveView($this->getRequestedView());

this work link is site/testaction





'testaction'=>array(

'class'=>'CViewAction',

'basePath'=>'application.views.site',

//'viewParam'=>'id',

'defaultView'=>'findme',

'view'=>'index', // no meter what is hire will not work

)



and this works link site/testaction?id=1





'testaction'=>array(

'class'=>'CViewAction',

'basePath'=>'application.views.site',

'viewParam'=>'id',

'defaultView'=>'findme',

'view'=>'index', // no meter what is hire will not work

)