Login   Register  
PHP Classes
elePHPant
Icontem

File: cache_ex.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Valics Lehel  >  Fast Template  >  cache_ex.php  >  Download  
File: cache_ex.php
Role: Example script
Content type: text/plain
Description: How to use cache function
Class: Fast Template
Updated revision of CDI Fast Template engine
Author: By
Last change: New function included, $ft->setCacheTime();
Date: 2005-01-02 09:56
Size: 589 bytes
 

Contents

Class file image Download
<?php
// $Id: cache_ex.php,v 1.4 2004/12/27 22:34:10 lvalics Exp $
// Cache Example
include "cls_fast_template.php";

$ft = new FastTemplate('./templates');

// CACHE will be used
$ft->setCacheTime(3);
$ft->USE_CACHE();

$ft->define(array("main"=>"cache.html"));

$data date("d/m/Y");
$ft->assign('DATA_ATUAL',$data);

$ft->assign("HORA",date("H:i:s"));

// Benchmarking
$start $ft->utime();
$end $ft->utime();
$runtime = ($end $start) * 1000;
$ft->assign("DEBUGSEC",$runtime);
// end Benchmarking

$ft->parse("BODY", array("main"));
$ft->FastPrint();
?>