Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  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: 2009-03-03 04:37
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
    

?>