Location: PHPKode > scripts > Generalized CachedTemplate class > class.HTMLTemplateAdaptor.php
<?php

/*
 * Class TemplateAdaptor (HTML_Template version)
 * by Jesus M. Castagnetto (hide@address.com)
 * (c) 2000. Version 1.1
 *
 * $Id: class.HTMLTemplateAdaptor.php,v 1.3 2000/07/16 19:33:46 jesus Exp $
 *
 * Description:
 * This class extends Herman's HTML_Template class
 * implementing methods and attributes needed for the CachedTemplate class.
 *
 * The adaptor class needs to implement the getTemplatesList() method that
 * returns an array with the names of the templates loaded, the init() 
 * method used to initialize the constructor of the parent template class,
 * and the getParsedDoc() method which returns the parsed document.
 *
 * Changes:
 * 2000/06/10 - Initial release.
 * 2000/07/17 - Documentation, new release.
 */


class TemplateAdaptor extends HTML_Template {

	/*
	 * This method is used to initialize the parent class
	 */

	function init() {
		// empty, class HTML_Template does not have a constructor
	}


	/*
	 * method to return the list of template names
	 */
	
	function getTemplatesList() {
		return array($this->filename);
	}


	/*
	 * method to return the parsed document
	 */
	
	function getParsedDoc($sect="") {
		if (empty($this->html))
			$this->code();
		return $this->html;
	}

} // end of class definition
?>
Return current item: Generalized CachedTemplate class