A simple template class.

v0.1 2019-10-20 22:28 UTC

This package is auto-updated.

Last update: 2024-06-08 23:18:03 UTC


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;

Basic Usage

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.