Location: PHPKode > scripts > ft classes > ft-classes/static_sample.php
//get the ft object
$ft=new FastTemplate(".");
//define template files.
$ft->define(array('main'=>'a_static.html','row' => 'b_static.html'));

//parse the 5000 rows in a for loop and assign some values
    //now parse the row in "append" mode.
    //this is done by adding a "."(dot) in front of "row" template
    //we send the output to TABLE_ROWS,the tag from the "main" template

//now assign all values for the "main" template and parse this too.
$ft->assign('HEADER','Two static templates 5000 rows test');

echo "Printed $i row(s) in ".microtime_diff($end,$start)." secconds<br>";

//print the content

function microtime_diff($a,$b) {
     list($a_micro, $a_int)=explode(' ',$a);
     list($b_micro, $b_int)=explode(' ',$b);
     if ($a_int>$b_int) {
        return ($a_int-$b_int)+($a_micro-$b_micro);
     } elseif ($a_int==$b_int) {
        if ($a_micro>$b_micro) {
           return ($a_int-$b_int)+($a_micro-$b_micro);
        } elseif ($a_micro<$b_micro) {
           return ($b_int-$a_int)+($b_micro-$a_micro);
        } else {
           return 0;
     } else { // $a_int<$b_int
        return ($b_int-$a_int)+($b_micro-$a_micro);
Return current item: ft classes