slimphp / PHP-View

A Simple PHP Renderer for Slim 3 & 4 (or any other PSR-7 project)
MIT License
264 stars 60 forks source link

Layout functionality #33

Closed cdekok closed 7 years ago

cdekok commented 8 years ago

It would be nice if there was a layout option, to not repeat html tags. Like this https://github.com/slimphp/PHP-View/pull/15/files

cdekok commented 7 years ago

Ok so you can do something like:

$content = $this->view->fetch('stuff.phtml', [
        'paginator' => $paginator
]);
$response = $this->view->render($response, 'layout.phtml', ['content' => $content]);

This should probably be documented.