getViewPath() public method

The default implementation returns the 'views' subdirectory under the directory containing the widget class file.
public getViewPath ( ) : string
return string the directory containing the view files for this widget.
Example #1
0
 /**
  * The method returns the view path for this widget if set while calling widget. 
  */
 public function getViewPath()
 {
     if (isset($this->templateDir)) {
         return $this->templateDir;
     }
     return parent::getViewPath();
 }
 /**
  * @inheritdoc
  */
 public function getViewPath()
 {
     if (empty($this->theme)) {
         return parent::getViewPath();
     } else {
         return \Yii::$app->getViewPath() . DIRECTORY_SEPARATOR . $this->theme;
     }
 }
 /**
  * @inheritdoc
  */
 public function getViewPath()
 {
     return empty($this->theme) ? parent::getViewPath() : \Yii::$app->getViewPath() . DIRECTORY_SEPARATOR . $this->theme;
 }
Example #4
0
 public function getViewPath()
 {
     return parent::getViewPath() . DIRECTORY_SEPARATOR . (new \ReflectionClass($this))->getShortName();
 }