ViewFish templating

Basics

ViewFish is a simple PHP templating library that is designed to be extremely simple to use. There are three steps to using a ViewFish template.

First, you instantiate the object and pass it the path to templates.

$t = new ViewFish\viewfish();

Next, you load your template of choice:

$template = $t->load_template('/path/to/template-name.tmpl');

Finally, you pass an associative array to the rendering function:

$html = $t->render($template,$data);

That's it. $html will now contain your ready-to-go output.

You can see the output at code.adamscheinberg.com