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 Eric Sizemore  >  Simple Template Engine  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example
Class: Simple Template Engine
Template engine based on text replacement
Author: By
Last change: Updated version number
Date: 2007-02-20 20:03
Size: 1,519 bytes
 

Contents

Class file image Download
<?php

/***************************************************************************
 *
 *   Author   : Eric Sizemore ( www.secondversion.com & www.phpsociety.com)
 *   Package  : Simple Template Engine
 *   Version  : 1.0.2
 *   Copyright: (C) 2006 - 2007 Eric Sizemore
 *   Site     : www.secondversion.com
 *   Email    : esizemore05@gmail.com
 *   File     : example.php
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 *   GNU General Public License for more details.
 *
 ***************************************************************************/

// Instantiate class
require_once('tpl.class.php');
$tpl =& new template();

/**
* assign expects an array of:
*     variable => value
*
* Variables in your template(s) should be in the form of:
*     {variable}
*/
$tpl->assign(array(
    
'title'   => 'Simple Template Engine Test',
    
'content' => 'This is a test of the <a href="http://www.phpclasses.org/browse/package/3171.html">Simple Template Engine</a> class by Eric Sizemore.'
));

// Parse the template file
$tpl->display('example.tpl');

?>