Home — v1.x

bobthecow edited this page Jul 9, 2012 · 2 revisions

Mustache is a simple, logic-less template engine.

We call it "logic-less" because there are no if statements, else clauses, or for loops. Instead there are only tags. Some tags are replaced with a value, some nothing, and others a series of values.


Mustache.php requires at least PHP 5.2.x to run.


Download the latest release as a zip, check out the Git repo as a submodule to your project, or simply copy the single Mustache.php file into your project directory.

Basic usage


First, you need to load the class into your project:

require_once '/path/to/project/mustache/Mustache.php';

There's no step two, really.

What are you waiting for?

$m = new Mustache;
echo $m->render('Hello, {{planet}}!', array('planet' => 'World')); // "Hello, world!"

Further documentation