Location: PHPKode > scripts > TPLManager > tplmanager/example1.php
<?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' 	=> 'hide@address.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());
}
?>
Return current item: TPLManager