The default implementation returns the 'views' subdirectory under the directory containing the widget class file.
public getViewPath ( ) : string | ||
Résultat | string | the directory containing the view files for this widget. |
/** * 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; }
public function getViewPath() { return parent::getViewPath() . DIRECTORY_SEPARATOR . (new \ReflectionClass($this))->getShortName(); }