src/Pdf/CakePdf.php
protected function _render()
    {
        $viewClass = $this->viewRender();
        $viewClass = App::className($viewClass, 'View', $viewClass == 'View' ? '' : 'View');

        $viewVars = [
            'theme',
            'layoutPath',
            'templatePath',
            'template',
            'layout',
            'helpers',
            'viewVars',
        ];
        $viewOptions = [];
        foreach ($viewVars as $var) {
            $prop = '_' . $var;
            $viewOptions[$var] = $this->{$prop};
        }

        $request = Router::getRequest(true);
        if (!$request) {
            $request = ServerRequestFactory::fromGlobals();
        }

        $View = new $viewClass(
            $request,
            null,
            null,
            $viewOptions
        );

        return $View->render();
    }
protected function _render()
    {
        $viewClass = $this->viewRender();
        $viewClass = App::className($viewClass, 'View', $viewClass == 'View' ? '' : 'View');

        $viewVars = [
            'theme',
            'layoutPath',
            'templatePath',
            'template',
            'layout',
            'helpers',
            'viewVars',
        ];
        $viewOptions = [];
        foreach ($viewVars as $var) {
            $prop = '_' . $var;
            $viewOptions[$var] = $this->{$prop};
        }

        $request = Router::getRequest(true);
        if (!$request) {
            $request = ServerRequestFactory::fromGlobals();
        }

        $View = new $viewClass(
            $request,
            null,
            null,
            $viewOptions
        );

        return $View->render();
    }
protected function _render ( ) { $ viewClass = $ this -> viewRender ( ) ; $ viewClass = App :: className ( $ viewClass , 'View' , $ viewClass == 'View' ? '' : 'View' ) ; $ viewVars = [ 'theme' , 'layoutPath' , 'templatePath' , 'template' , 'layout' , 'helpers' , 'viewVars' , ] ; $ viewOptions = [ ] ; foreach ( $ viewVars as $ var ) { $ prop = '_' . $ var ; $ viewOptions [ $ var ] = $ this -> { $ prop } ; } $ request = Router :: getRequest ( true ) ; if ( ! $ request ) { $ request = ServerRequestFactory :: fromGlobals ( ) ; } $ View = new $ viewClass ( $ request , null , null , $ viewOptions ) ; return $ View -> render ( ) ; }
Build and set all the view properties needed to render the layout and template.

@return array The rendered template wrapped in layout.
Build and set all the view properties needed to render the layout and template .