yii\base\Module::getLayoutPath PHP Method

getLayoutPath() public method

Returns the directory that contains layout view files for this module.
public getLayoutPath ( ) : string
return string the root directory of layout files. Defaults to "[[viewPath]]/layouts".
    public function getLayoutPath()
    {
        if ($this->_layoutPath === null) {
            $this->_layoutPath = $this->getViewPath() . DIRECTORY_SEPARATOR . 'layouts';
        }
        return $this->_layoutPath;
    }

Usage Example

Example #1
0
 public function getLayoutPath()
 {
     if ($this->useAppLayoutPath) {
         $this->setLayoutPath('@app/views/' . $this->id . '/layouts');
     }
     return parent::getLayoutPath();
 }