File: example.php

Recommend this page to a friend!
  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: 10 years ago
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');
?>


For more information send a message to info at phpclasses dot org.