PHP Classes

File: examples/customDelimiter.php

Recommend this page to a friend!
  Classes of Eric Sizemore   Simple Template Engine   examples/customDelimiter.php   Download  
File: examples/customDelimiter.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Simple Template Engine
Template engine based on text replacement
Author: By
Last change:
Date: 1 year ago
Size: 1,650 bytes


Class file image Download

 * Simple Template Engine
 * @author Eric Sizemore <>
 * @package Simple Template Engine
 * @link
 * @version 1.0.5
 * @copyright (C) 2006-2019 Eric Sizemore
 * @license GNU Public License
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <>.

// Include class file and instantiate.
require_once '../src/Template.php';
$tpl = new \Esi\Template();

// Set custom delimiters:

* assign expects an array of:
* variable => value
* Variables in your template(s) should now be in the form of:
* {%variable%}
'title' => 'Simple Template Engine Test',
'content' => 'This is a test of the <a href="">Simple Template Engine</a> class by Eric Sizemore.'

// Parse the template file

// It's that simple, really.