Phrozn/Site/View/Base.php
protected function applyLayout($content, $vars)
    {
        $layoutName = $this->getParam('page.layout', ViewFactory::DEFAULT_LAYOUT_SCRIPT);

        $inputFile = $this->getInputFile();
        $inputFile = str_replace('\\', '/', $inputFile);

        $pos = strpos($inputFile, '/entries');
        // make sure that input path is normalized to root entries directory
        if (false !== $pos) {
            $inputFile = substr($inputFile, 0, $pos + 8) . '/entry';
        }

        $layoutPath = realpath(dirname($inputFile) . '/../layouts/' . $layoutName);

        $factory = new ViewFactory($layoutPath);
        $layout = $factory->create(); // essentially layout is Site\View as well
        $layout->hasLayout(false); // no nested layouts

        $vars['content'] = $content;
        $vars['entry'] = $vars['page'];
        return $layout->render($vars);
    }
protected function applyLayout($content, $vars)
    {
        $layoutName = $this->getParam('page.layout', ViewFactory::DEFAULT_LAYOUT_SCRIPT);

        $inputFile = $this->getInputFile();
        $inputFile = str_replace('\\', '/', $inputFile);

        $pos = strpos($inputFile, '/entries');
        // make sure that input path is normalized to root entries directory
        if (false !== $pos) {
            $inputFile = substr($inputFile, 0, $pos + 8) . '/entry';
        }

        $layoutPath = realpath(dirname($inputFile) . '/../layouts/' . $layoutName);

        $factory = new ViewFactory($layoutPath);
        $layout = $factory->create(); // essentially layout is Site\View as well
        $layout->hasLayout(false); // no nested layouts

        $vars['content'] = $content;
        $vars['entry'] = $vars['page'];
        return $layout->render($vars);
    }
protected function applyLayout ( $ content , $ vars ) { $ layoutName = $ this -> getParam ( 'page.layout' , ViewFactory :: DEFAULT_LAYOUT_SCRIPT ) ; $ inputFile = $ this -> getInputFile ( ) ; $ inputFile = str_replace ( '\\' , '/' , $ inputFile ) ; $ pos = strpos ( $ inputFile , '/entries' ) ; // make sure that input path is normalized to root entries directory if ( false !== $ pos ) { $ inputFile = substr ( $ inputFile , 0 , $ pos + 8 ) . '/entry' ; } $ layoutPath = realpath ( dirname ( $ inputFile ) . '/../layouts/' . $ layoutName ) ; $ factory = new ViewFactory ( $ layoutPath ) ; $ layout = $ factory -> create ( ) ; // essentially layout is Site\View as well $ layout -> hasLayout ( false ) ; // no nested layouts $ vars [ 'content' ] = $ content ; $ vars [ 'entry' ] = $ vars [ 'page' ] ; return $ layout -> render ( $ vars ) ; }
Two step view is used. View to wrap is provided with content variable.

@param string $content View text to wrap into layout
@param array $vars List of variables passed to processors

@return string
Two step view is used . View to wrap is provided with content variable .