PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Muhammad Arfeen   TemplateEngine   index.php   Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example usage script
Class: TemplateEngine
Template engine that replaces marks with variables
Author: By
Last change:
Date: 15 years ago
Size: 746 bytes
 

Contents

Class file image Download
<?php

/*
    example usage for TemplateEngine class.

*/

include_once "TemplateEngine.inc.php"; // Class file inclusion

$TempleteEngine = new TemplateEngine("TENG"); // Constructor with place holder prefix as argument.

$HL = array();

/* Values are being replaced with place holders.
     Extra place holders in html file will be replaced, even if the values are not supplied.
*/

$HL['[TENG_Title]'] = "Page title";
$HL['[TENG_Alert]'] = "Please provide value";
$HL['[TENG_FormAction]'] = "http://www.example.com";

$HL['[TENG_ButtonLabel]'] = "Continue...";
$HL['[TENG_Example]'] = "TemplateEngine";

print
$TempleteEngine->LoadTemplate("php.html",$HL); // Loading and processing html template
   

?>