new Embrace()
is a personal study case for template engineering that could be
simple and fast as resourceful enough to support a complex application.
Embrace is under the open source MIT License (MIT).
See ./COPY for more information.
- PHP 5.3+
In your logical file, e.g. index.php:
#!php
<?php
require_once 'Embrace.class.php';
$embraced = new Embrace('template.php');
$embraced->foo = 'Hello world!';
$embraced(); # Short hand for Embrace->render()
In your template file, e.g. template.php:
#!html
<quote>
I have some to say to you:<br />
<strong>[[$foo]]</strong> <!-- Could be [[foo]] also! -->
</quote>
Will generate cache file, e.g. ~template.html, and output:
I have some to say to you:
Hello world!
- General logical analysis (===, !==, <, >, <=, >=);
- Template hierarchy with parentage resolution
[[include:section.php]]
; - Literal
[[literal]] [[render as is]] [[/literal]]
; - PHP code interpretation
[[php]] print 'Embraced!'; [[/php]]
; - Cache per file with hierarchy influence, e.g. child with cache disabled turns off parents cache;
- Some others... (laziness)
See ./Embrace/demo for some usage cases. (soon)
Not yet. Will be welcome any related experience.
See Issues list. If you find something be welcome to contribute with a ticket.
Nothing defined yet. But evolves ever! ;)