PHP code example of brunodebarros / mustache.php
1. Go to this page and download the library: Download brunodebarros/mustache.php library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
brunodebarros / mustache.php example snippets
$m = new Mustache_Engine;
echo $m->render('Hello {{planet}}', array('planet' => 'World!')); // "Hello World!"
class Chris {
public $name = "Chris";
public $value = 10000;
public function taxed_value() {
return $this->value - ($this->value * 0.4);
}
public $in_ca = true;
}
$m = new Mustache_Engine;
$chris = new Chris;
echo $m->render($template, $chris);