yii\base\Module::getViewPath PHP 메소드

getViewPath() 공개 메소드

Returns the directory that contains the view files for this module.
public getViewPath ( ) : string
리턴 string the root directory of view files. Defaults to "[[basePath]]/views".
    public function getViewPath()
    {
        if ($this->_viewPath === null) {
            $this->_viewPath = $this->getBasePath() . DIRECTORY_SEPARATOR . 'views';
        }
        return $this->_viewPath;
    }

Usage Example

예제 #1
0
파일: Controller.php 프로젝트: bobxia/yii2
 /**
  * Returns the directory containing view files for this controller.
  * The default implementation returns the directory named as controller [[id]] under the [[module]]'s
  * [[viewPath]] directory.
  * @return string the directory containing the view files for this controller.
  */
 public function getViewPath()
 {
     if ($this->_viewPath === null) {
         $this->_viewPath = $this->module->getViewPath() . DIRECTORY_SEPARATOR . $this->id;
     }
     return $this->_viewPath;
 }
All Usage Examples Of yii\base\Module::getViewPath