Skip to content
A wrapper that allows for the execution of Handlebars.js on the server-side.
PHP
Find file
Latest commit 7475efe Nov 6, 2012 @crxgames Implemented suggested in Issue #1
Implemented suggested in Issue #1 to use json_encode to allow for much
better json encoding of multidimensional arrays.
Failed to load latest commit information.
.gitignore
PHPHandles.php
PHPHandlesTest.php
README.md
TemplateTest.html

README.md

PHPHandles

PHPHandles is a wrapper that allows for the execution of Handlebars.js on the server-side. This allows you to use the full functionality of Handlebars.js as a template engine for your site, while also using the same templates on the front end.

Usage

Usage of PHPHandles is easy! Just include PHPHandles.php and you're set. Everything needed is in the PHPHandles namespace.

include('PHPHandles.php');

$PHPHandles = new PHPHandles\PHPHandles('./handlebars.js');
$tplVars = array(
    'title' => 'My post',
    'body' => 'This is some body text!'
);
echo $PHPHandles->SetVarsArr($tplVars)->ProcessFile('./TemplateTest.html');
Something went wrong with that request. Please try again.