Location: PHPKode > scripts > ft classes > ft-classes/test_unit_b.php
//here is a quick sample and benchmark for a nested dymaick block in one file
//create the class object and set the root path
$ft=new ft('.');
//define one template file
$ft->define(array('main' => 'b_dynamic.html'));
//define the dynamic block inside the 'main' template
//nested dynamic block(inside the a_row) 

//do a 500 rows loop for the first block and assign $i to a tag... 
    $ft->assign('NESTED_HEADER','Nested Block '.$i);
    //clean out the BROW_OUT content

$ft->assign('A','5000  nested dynamic block test');
//parse the template.
echo "Printed $z rows in ".microtime_diff($end,$start);
//print and get back here

 * @return float
 * @param a string
 * @param b string
 * @desc (From php manual) compute the microtime diff format.
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