p3k/slim-savant

Savant renderer for Slim

0.1.0 2015-07-21 01:40 UTC

This package is auto-updated.

Last update: 2024-06-28 07:52:13 UTC


README

Usage

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');