Returns the directory that contains layout view files for this module.
@return string the root directory of layout files. Defaults to "[[viewPath]]/layouts".
434498
public function getLayoutPath( $sufix = 'layouts' )
	{
		if( $this->_layoutPath === null ) {
			
			$path = parent::getLayoutPath();
			
			if( !is_dir( $path ) && $parentPath = $this->getParentPath( $sufix ) ) {
				
				$path = $parentPath;
				
			}
			
			$this->_layoutPath = $path;
		}
		
		return $this->_layoutPath;
	}
311112
private function getDirectory()
    {
        // Fallback to default directory if no storage path defined
        if (defined('CRAFT_STORAGE_PATH')) {
            $basePath = CRAFT_STORAGE_PATH;
        } else {
            $basePath = CRAFT_BASE_PATH . DIRECTORY_SEPARATOR . 'storage';
        }

        return $basePath . DIRECTORY_SEPARATOR . 'runtime' . DIRECTORY_SEPARATOR . 'htmlcache' . DIRECTORY_SEPARATOR;
    }
1158315
public function getPageLayout()
    {
        // Obtain Page Layout:
        
        if ($this->hasPageLayout()) {
            $layout = $this->owner->MyLayout();
        } else {
            $layout = $this->getDefaultLayout();
        }
        
        // Answer Page Layout (if available and enabled):
        
        if ($layout && $layout->isEnabled()) {
            return $layout;
        }
    }
1166344
public function getViews()
    {
        $config = $this->config;
        $directories = array();
        $dir = $this->directory;
        if (isset($config['app']['views'])) {
            $directoriesTmp = $config['app']['views'];
            if (!is_array($directoriesTmp)) {
                $directoriesTmp = array($directoriesTmp);
            }
            foreach ($directoriesTmp as $directory) {
                $this->addFolder($directories, $dir . '/' . $directory);
            }
        }
        return $directories;
    }
1359706
public function getBlockPath()
    {
        if ($this->getPackageID() > 0) {
            $pkgHandle = $this->getPackageHandle();
            $dirp = (is_dir(DIR_PACKAGES . '/' . $pkgHandle)) ? DIR_PACKAGES : DIR_PACKAGES_CORE;
            $dir = $dirp . '/' . $pkgHandle . '/' . DIRNAME_BLOCKS . '/' . $this->getBlockTypeHandle();
        } else {
            if (is_dir(DIR_FILES_BLOCK_TYPES . '/' . $this->getBlockTypeHandle())) {
                $dir = DIR_FILES_BLOCK_TYPES . '/' . $this->getBlockTypeHandle();
            } else {
                $dir = DIR_FILES_BLOCK_TYPES_CORE . '/' . $this->getBlockTypeHandle();
            }
        }

        return $dir;
    }
1021355
public function getModulePath(): string
    {
        $reflector = new ReflectionClass(get_class($this));
        $fn = $reflector->getFileName();
        $directory = dirname($fn);
        return $directory;
    }
500656
public function getRootPath()
    {
        $appPath = app_path();
        $folders = explode(DIRECTORY_SEPARATOR, $appPath);
        array_pop($folders);
        $rootPath = implode(DIRECTORY_SEPARATOR, $folders);

        return $rootPath . '/';
    }
1205781
public function getRootDirectory()
    {
        $dir = $this->getWorktreeDirectory();
        $relativeRoot = trim(str_replace(DIRECTORY_SEPARATOR, '/', $this->gitRepository->getDirectoryToParse()), '/');
        if ($relativeRoot !== '') {
            $dir .= '/' . $relativeRoot;
        }

        return $dir;
    }
121685
public function getRootDir()
    {
        static $dir;
        if (empty($dir)) {
            $rc = new \ReflectionClass(get_class($this));
            $dir = dirname(dirname($rc->getFileName()));
        }
        return $dir;
    }
982335
public function getFilesetTwig() {
    $finder = $this->getTwigFilesetFinder();
    $finder->in([$this->getConfigValue('docroot') . '/themes/custom']);
    $finder->in([$this->getConfigValue('docroot') . '/modules/custom']);

    return $finder;
  }
1219084
public function getModuleLayoutViewPath()
    {
        if ($this->module->useAppViewPath) {
            return '@app/views/'.$this->module->id.'/';
        }
        
        return '@'.$this->module->id.'/views/';
    }
1165151
public function getThemesFromDir()
	{
		$themeList = array();
		$themePath = Yii::getPathOfAlias('webroot.themes');
		$themes    = scandir($themePath);
		foreach($themes as $theme) {
			$themeName = $this->urlTitle($theme);
			$themeFile = $themePath.'/'.$theme.'/'.$themeName.'.yaml';
			if(file_exists($themeFile)) {
				if(!in_array($themeName, $this->getIgnoreTheme())) {
					$themeList[] = $theme;
				}
			}
		}

		if(count($themeList) > 0)
			return $themeList;
		else
			return false;
	}
51641
public function getViewPath()
    {
        $ref = new \ReflectionClass($this);
        $controllerId = str_replace('Controller', '', $ref->getShortName());
        $path = dirname(dirname($ref->getFileName()));
        return $path . '/views/' . lcfirst($controllerId);
    }
252138
private function getLayoutPath($layout = null, $fromTheme = false) {
        $layout = ($layout === null) ? $this->view->getController()->getLayout() : $layout;
        if (!$layout)
            return false;

        if (!$fromTheme && is_readable(MODULES . $this->view->getModule() . DIRECTORY_SEPARATOR . 'View' .
                        DIRECTORY_SEPARATOR . 'layouts' . DIRECTORY_SEPARATOR . $layout .
                        '.phtml'))
            return MODULES . $this->view->getModule() . DIRECTORY_SEPARATOR . 'View' .
                    DIRECTORY_SEPARATOR . 'layouts' . DIRECTORY_SEPARATOR . $layout .
                    '.phtml';
        elseif (is_readable(THEMES . engineGet('config', 'defaults', 'theme') .
                        DIRECTORY_SEPARATOR . 'layouts' . DIRECTORY_SEPARATOR . $layout . '.phtml'))
            return THEMES . engineGet('config', 'defaults', 'theme') . DIRECTORY_SEPARATOR .
                    'layouts' . DIRECTORY_SEPARATOR . $layout . '.phtml';
        else {
            throw new Exception('Layout "' . $layout . '" not found both at the module and theme levels');
        }
    }
730028
public function getLayout()
    {
        $page = $this->CurrentPage;
        $customTemplate = $this->Style ? '_'.$this->Style : '';
        $pageType = $page->ClassName ? '_'.$page->ClassName : '';
        $className = $this->ClassName;
        $templates = array(
            $className.$pageType.$customTemplate,
            $className.$customTemplate,
            $className.$pageType,
            $className,
            'DefaultPlacement'
        );
        $this->extend('updateLayout', $templates);
        return $this->renderWith($templates, $this->getController());
    }
1011043
function getLayout()
    {
        $layoutName = ($this->layout) ? $this->layout
            : $this->getDefaultLayoutName();

        if (strstr($layoutName, '/') === false) {
            // we have just layout name
            // the directory prefix assigned to it
            $DS = (defined('DS')) ? constant('DS') : DIRECTORY_SEPARATOR;
            // derive default layout pathname
            $pathname =
                self::$PATH_PREFIX               # widgets
                .$DS
                .$this->deriveLayoutPathPrefix() # namespace_widget\widget_name\
                .$DS
                .$layoutName;

            $this->layout = $pathname;
        }

        return $this->layout;
    }
1103995
public static function rootDir()
    {
        $instance = self::instance();
        if ( !$instance->RootDir )
        {
            $cwd  = getcwd();
            $self  = $instance->serverVariable( 'PHP_SELF' );
            if ( file_exists( $cwd . $instance->FileSeparator . $self ) or
                 file_exists( $cwd . $instance->FileSeparator . $instance->IndexFile ) )
            {
                $instance->RootDir = $cwd;
            }
            else
            {
                $instance->RootDir = null;
            }
        }
        return $instance->RootDir;
    }