Login   Register  
PHP Classes
elePHPant
Icontem

File: example1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Gregory Patmore  >  TPLManager  >  example1.php  >  Download  
File: example1.php
Role: Example script
Content type: text/plain
Description: example
Class: TPLManager
Template engine that uses regular expressions
Author: By
Last change:
Date: 6 years ago
Size: 928 bytes
 

Contents

Class file image Download
<?php
/**
 * example1.php 
 * Example usage of the TPLManager using the load-n-launch method
 * 
 * @author Gregory Patmore (mail at gregorypatmore dot com)
 * @version 1.0
 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
 * @package TPLManager
 * @access public
 */
try{
    
/* Include the file. */
    
include('tplmanager.class.php');
    
    print 
"Example Usage of the TPLManager class using the LOAD-N-LAUNCH method";
    

    
/* Create the replacements array */
    
$repls = array(
        
'NAME'             => 'John Q. Public',
        
'SUPPORTEMAIL'     => 'mail@gregorypatmore.com',
        
'MY_NAME'         => 'Gregory Patmore'
    
);
    
    
/* Create a TPLManager and send it the values */
    
$t = new TPLManager('thanks_email.tpl'$repls);
    
    
/* Retrieve the processed text */
    
$procTxt $t->getParsed();
    
    
/* (Do something useful with it here) */
    
print '<pre>' $procTxt '</pre>';
    exit;
    
}catch(
Exception $e){
    exit(
$e->getMessage());
}
?>