src/core/ViewFactory.php
public static function createLayout(string $layoutName, View $view): ?Layout
    {
        $layoutsRoot = AppHelper::getInstance()->getComponentRoot('layouts');
        $layoutFile  = $layoutsRoot.\DIRECTORY_SEPARATOR
            .strtolower($layoutName).'.php';
        if (is_readable($layoutFile)) {
            return new Layout($layoutFile, $view);
        }
        return null;
    }
public static function createLayout(string $layoutName, View $view): ?Layout
    {
        $layoutsRoot = AppHelper::getInstance()->getComponentRoot('layouts');
        $layoutFile  = $layoutsRoot.\DIRECTORY_SEPARATOR
            .strtolower($layoutName).'.php';
        if (is_readable($layoutFile)) {
            return new Layout($layoutFile, $view);
        }
        return null;
    }
public static function createLayout ( string $ layoutName , View $ view ) : ? Layout { $ layoutsRoot = AppHelper :: getInstance ( ) -> getComponentRoot ( 'layouts' ) ; $ layoutFile = $ layoutsRoot . \ DIRECTORY_SEPARATOR . strtolower ( $ layoutName ) . '.php' ; if ( is_readable ( $ layoutFile ) ) { return new Layout ( $ layoutFile , $ view ) ; } return null ; }
It creates a layout object.
@param string $layoutName The layout name.
@param \nadir2\core\View $view The object of view.
@return \nadir2\core\Layout|null It returns null if layout file isn't
readable.
It creates a layout object .