FluxTE
FluxTE or Flux Template Engine is a lightweight, logical and best of all open source template engine for PHP.
It uses a very easy to learn syntax and is very scalable.
Example
index.php:
PHP Code:
<?php
// Include FluxTE.
include_once('../FluxTE.php');
// Instanciate.
$template = new FluxTE();
// Set template root to current directory.
$template->SetTemplateRoot(dirname(__FILE__));
// Assign some mock values.
$template->AssignValue('test', true);
$template->AssignValue('out_test', 'BUDDY');
$template->AssignValue('file_test', 'include');
// Display.
$template->Display('template.tpl');
?>
template.tpl:
PHP Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>FluxTE.php Example</title>
</head>
<body>
<h2>Hello World</h2>
<p>
{if($test)}
Test is assigned!
{else}
Test is not assigned!
{/if}
</p>
<p>
Content of out_test is: {($out_test)}
</p>
<p>
This is included: {include($file_test.tpl)}
</p>
<p>
If without else: {if($test)}{($out_test)}{/if}
</p>
</body>
</html>
Download
All source code and examples used in this post is available on github.
Notes
More in-depth documentation will be available later on as I don't have the time to write it up at the moment.