PHP Classes
Icontem

File: ftc_test.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Cornel Alexa  >  ft  >  ftc_test.php  
File: ftc_test.php
Role: Example script
Content type: text/plain
Description: Test/Sample file for ft_cache class.
Class: ft
Template engine with nested dynamic blocks
 

Contents

Class file image Download
<?php
include("cls_ft_cache.php");
//call this page with different parameters 
//like ftc_test.php?t=1 or t=2,etc.. to see how context
//work.You will see the cache files in the cache folder.
//If they don't show up,then change the max_runtime to 
//something like 0.0002
//See the class file for more info...

$ft=new ft_cache(".",".");
//play with this and the for loop value
//but don't forget to clear already cached files
//or change the timestamp (touch()) of cache.info file
//from your cache folder.
$ft->max_runtime=1//one seccond
$ft->init();
$ft->define(array('main' => 'a_static.html','row' => 'b_static.html'));
//check if a cache was found.If so the 
//hang the script here.Also instead of ft_print() we can get 
//the cache content in a var and do other actions on it...
if($ft->cache)
{
     echo 
"Page served from cache.<br>";
     
$ft->ft_print('_CACHE_');
     die();
}
//from here on is normal template use.
$ft->assign("HEADER",'Cached Test');
for(
$i=1;$i<3000;$i++)
{
    
$ft->assign('CELL_TEXT',$i);
    
$ft->parse('TABLE_ROWS','.row');
}
$ft->parse('MAIN','main');
$ft->ft_print('MAIN');
?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products