framework/web/actions/CViewAction.php
protected function resolveView($viewPath)
	{
		// start with a word char and have word chars, dots and dashes only
		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)));
	}
protected function resolveView($viewPath)
	{
		// start with a word char and have word chars, dots and dashes only
		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)));
	}
protected function resolveView ( $ viewPath ) { // start with a word char and have word chars, dots and dashes only 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 ) ) ) ; }
Resolves the user-specified view into a valid view name.
@param string $viewPath user-specified view in the format of 'path.to.view'.
@return string fully resolved view in the format of 'path/to/view'.
@throws CHttpException if the user-specified view is invalid
Resolves the user - specified view into a valid view name .