PHP Classes

File: class.FastTemplateAdaptor.php

Recommend this page to a friend!
  Classes of Jesus M. Castagnetto  >  Generalized CachedTemplate class  >  class.FastTemplateAdaptor.php  >  Download  
File: class.FastTemplateAdaptor.php
Role: ???
Content type: text/plain
Description: Template Adaptor class for FastTemplate
Class: Generalized CachedTemplate class
General Template Caching class
Author: By
Last change:
Date: 22 years ago
Size: 1,461 bytes
 

Contents

Class file image Download
<?php

/*
 * Class TemplateAdaptor (FastTemplate version)
 * by Jesus M. Castagnetto (jmcastagnetto@zkey.com)
 * (c) 2000. Version 1.1
 *
 * $Id: class.FastTemplateAdaptor.php,v 1.3 2000/07/16 19:33:46 jesus Exp $
 *
 * Description:
 * This class extends CDI's (cdi@thewebmasters.net) FastTemplate 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 FastTemplate {

	var $TEMPLATES = array();
	
	/*
	 * This method is used to initialize the parent class
	 */

	function init($pathToTemplates="") {
		$this->FastTemplate($pathToTemplates);
	}

	/*
	 * method to return the list of template names
	 */
	
	function getTemplatesList() {
		if (count($this->FILELIST) > 0 ) {
			while (list($tag, $fn) = each($this->FILELIST))
				$this->TEMPLATES[] = $this->ROOT.$fn;
		}
		return $this->TEMPLATES;
	}

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

} // end of class definition
?>
For more information send a message to info at phpclasses dot org.