<?php
include ("Template.inc");
print "Testing template loading from disk\n<BR>";
//this will read in the file "test.template" and replace the delimiters
//in it with the results of the db query below. You can also populate
//from as Hash, but I have little use for this and have not tested it
//thoroughly. In this case, it's intended to take a hash like $_COOKIE
//and replace delimiters of the form "#<cookie name>#" with the cookie
//value. For replacing with db queries, delimiters should always be of
//the form "#f1#" through "#fN#" where the pound sign, the "f" and the
//last pound sign are static and the number refers to the column's
//1-based index in the result set. See the Temlate class for how to
//change the delimter and how to read from an input snippet instead of a
//file. Also see the DropDown class for a real example of this class.
$template = new Template("test.template");
print "" . $template->processQuery("SELECT id, member_name FROM members");
?>
|