Login   Register  
PHP Classes
elePHPant
Icontem

File: README.TXT

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Rob Thomson  >  Template Handler  >  README.TXT  >  Download  
File: README.TXT
Role: Documentation
Content type: text/plain
Description: Readme File
Class: Template Handler
Template handler class to separate HTML from code
Author: By
Last change:
Date: 10 years ago
Size: 1,082 bytes
 

Contents

Class file image Download
#################################################
Template Handler Class
#################################################

The template_handler class is a simple class designed to
assist the developer in wring PHP code, without all the issues
related to embeding HTML in the code.

The class works on a simple principle.  

-  Create an HTML page, and wherever you want 
   dynamic content to be inserted on the page insert
   a 'tag'  i.e:  {content}
   
-  Using the template handler, open the template,
   and set the objects
   
- display the template


=======================================
	sample code
=======================================

<?

# load the new template template
$template = new template_handler();
$template->setBaseDir("templates/");
$template->setTemplate("template.htm");

$template->setObject('content','This is the content');

print $template->Retrieve();

?>


===================================
	sample template
===================================

<html>
<body>
<hr>
{content}
</body>
</html>

-