A simple template class, originally created in 2006.
Require this package with Composer in the root directory of your project.
composer require enricodias/template
Then you can import the class into your application:
use enricodias\Template;
The class works by loading files in memory and replacing variables delimited by {$
and }
.
$Template = new Template('/path/to/file.tpl'); // Load file.tpl
$Template->replace('var', 'Random Value'); // replace "{$var}" with "Random Value"
echo $Template;
A more detailed documentation specifying all features is available in the Wiki.