p3k/slim-savant

Savant renderer for Slim

0.1.0 2015-07-21 01:40 UTC

This package is auto-updated.

Last update: 2024-10-28 08:28:37 UTC


README

Setup

In your public/index.php, add this line:

\Slim\Savant\init();

Render

In your controller, you can use the render helper function. The helper function assumes your master layout is called views/layout.php.

In PHP 5.6, you can alias the render function:

use function \Slim\Savant\render;

render('index');

Below 5.6, you'll need to do the following:

use \Slim\Savant;

Savant\render('index');

Partials

Savant\partial('foo');