yii\base\Widget::getViewPath PHP Метод

getViewPath() публичный Метод

The default implementation returns the 'views' subdirectory under the directory containing the widget class file.
public getViewPath ( ) : string
Результат string the directory containing the view files for this widget.
    public function getViewPath()
    {
        $class = new ReflectionClass($this);
        return dirname($class->getFileName()) . DIRECTORY_SEPARATOR . 'views';
    }

Usage 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();
 }
All Usage Examples Of yii\base\Widget::getViewPath