Justin Hileman 1d21de63d6 Trailing slash test fix.
I suppose it would help if I didn't realpath the thing I was testing for realpathness
2013-07-15 18:11:36 -04:00
2013-05-10 17:24:53 -07:00
2013-07-15 18:11:36 -04:00
2013-03-12 16:20:02 -07:00
2013-01-12 09:10:33 -08:00
2013-03-12 16:20:02 -07:00
2012-05-17 16:21:14 -07:00
2012-10-01 15:46:14 -07:00
2013-04-15 19:51:41 -07:00

Mustache.php

A Mustache implementation in PHP.

Build Status

Usage

A quick example:

<?php
$m = new Mustache_Engine;
echo $m->render('Hello {{planet}}', array('planet' => 'World!')); // "Hello World!"

And a more in-depth example -- this is the canonical Mustache template:

Hello {{name}}
You have just won ${{value}}!
{{#in_ca}}
Well, ${{taxed_value}}, after taxes.
{{/in_ca}}

Create a view "context" object -- which could also be an associative array, but those don't do functions quite as well:

<?php
class Chris {
    public $name  = "Chris";
    public $value = 10000;

    public function taxed_value() {
        return $this->value - ($this->value * 0.4);
    }

    public $in_ca = true;
}

And render it:

<?php
$m = new Mustache_Engine;
$chris = new Chris;
echo $m->render($template, $chris);

And That's Not All!

Read the Mustache.php documentation for more information.

See Also

S
Description
No description provided
Readme MIT
1.3 MiB
Languages
PHP 100%