PHP Classes

File: example_2.php

Recommend this page to a friend!
  Classes of Valics Lehel   Fast Template   example_2.php   Download  
File: example_2.php
Role: Example script
Content type: text/plain
Description: example 2
Class: Fast Template
Updated revision of CDI Fast Template engine
Author: By
Last change: Cosmetics
Date: 19 years ago
Size: 1,767 bytes
 

Contents

Class file image Download
<?
// $ID$
// Example FastTemplate demo #2: Build a linear web page. (top down)
// Check your error_log when this is done - this demo has unresolved
// variables defined in footer.html. (On purpose of course :)

// Header("Content-type: text/plain"); // If you want to see the
                                        // raw html in your browser,
                                        // uncomment this.

include("cls_fast_template.php");
$ft = new FastTemplate("./templates");

$start = $ft->utime(); // Benchmarking

$ft->define(
    array(
       
'header' => "header.html",
       
'body' => "middle.html",
       
'footer' => "footer.html"
   
)
);

$ft->assign( array(
                       
'TITLE' => "FastTemplate Demo2",
                       
'HEAD1' => "FastTemplate Page Demo",
                       
'TD1' => "Column 1",
                       
'TD2' => "Column 2",
                       
'TD3' => "Cool Stuff",
                       
'TD4' => '<BLINK>Cooler Stuff</BLINK>',
                       
'MAILTO' => 'cdi@thewebmasters.net',
                       
'LINK' => 'www.thewebmasters.net/php/',
                       
'LINKNAME' => 'The WebMasters Net'
           
) );

$ft->parse('HEAD', "header");
$ft->parse('BODY', "body");
$ft->parse('FOOT', "footer");

// $ft->clear(array("HEAD","BODY")); // Uncomment this to see how
                                        // the class handles errors

   
$ft->showDebugInfo(2);
$ft->FastPrint("HEAD");
$ft->FastPrint("BODY");
$ft->FastPrint("FOOT");

$end = $ft->utime();
$runtime = ($end - $start) * 1000;
echo
"Completed in $runtime seconds<BR>\n";

exit;

?>