One small single file with a Template engine for small PHP Apps.
TinyTemplate provides:
- replacing
{{variable}}
in the template.
That's all.
You can simply download the TinyRest.php file, put it somewhere on your disk and include it from your script.
include('TinyTemplate.php`);
You can get the repository from Github: https://github.com/aoloe/php-tiny-template...
... and then link it in your projects composer.json
by the path on your computer:
"repositories": [
{
"type": "path",
"url": "/your/path/to/php-tiny-template"
}
],
"require": {
"aoloe/tiny-template": "@dev"
}
See the test script below for a basic usage (and TinyRest cannot do much more than that...).
You can also tell Composer to get the TinyRest from Github:
"repositories": [
{
"type": "vcs",
"url": "git@github.com:aoloe/php-tiny-template.git"
},
],
"require": {
"aoloe/tiny-template": "dev-master"
}
See the test script below for a basic usage (and TinyRest cannot do much more than that...).
<?php
include('TinyTemplate.php');
echo(TinyTemplate::factory()->
add('body', '<p>Welcome</p>')->
fetch('<html><body>{{body}}</body></html>');