Skip to content

Instantly share code, notes, and snippets.

@smarden1
Last active August 29, 2015 14:02
Show Gist options
  • Save smarden1/470f67980f006832a667 to your computer and use it in GitHub Desktop.
Save smarden1/470f67980f006832a667 to your computer and use it in GitHub Desktop.
#!/usr/bin/env php
<?php
include('mustache.php');
$engine = new Mustache_Engine(array());
$data = array("title" => "TITLE");
$template = "{{{title}}}";
$output = $engine->render($template, $data);
echo("\n $output for $template");
$template = "{{{title}}";
$output = $engine->render($template, $data);
echo("\n $output for $template");
$template = "{{{title}}other";
$output = $engine->render($template, $data);
echo("\n $output for $template");
echo("\n");
*****************************
2554:mustache.php smardenfeld$ php test.php
TITLE for {{{title}}}
TITLE for {{{title}}
TITLEther for {{{title}}other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment