enricodias/template

A simple template class.

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

This package is auto-updated.

Last update: 2024-04-08 23:04:03 UTC


README

A simple template class, originally created in 2006.

Installation

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;

Documentation

A more detailed documentation specifying all features is available in the Wiki.