Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Gianluca Zanferrari  >  abc template  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: abc template
Template engine that replaces tags in PHP scripts
Author: By
Last change:
Date: 2010-08-05 05:16
Size: 467 bytes
 

Contents

Class file image Download
<?php
/*
* this is an example with simple data pairs; each key of the array represents the tag to be replaced and the value is the data. 
*/

/*
* template processor
*/
require('class_template.php');
$page = new Page("page.html");

/*
* here we go; replace all placeholders
*/
$page->replace_tags(array(
                
'first' => 'This is my first sentence'
                
,'rand' => 'And this is my random #: ' rand(100,999)
                ));

$page->output('ISO-8859-15');
?>