PHP Classes

File: alternative.php

Recommend this page to a friend!
  Classes of Evgeny  >  tplTemplatez  >  alternative.php  >  Download  
File: alternative.php
Role: Example script
Content type: text/plain
Description: example
Class: tplTemplatez
Template class used to separate PHP and HTML
Author: By
Last change:
Date: 18 years ago
Size: 623 bytes
 

Contents

Class file image Download
<?php
require ('../tplTemplatez.php');


// load template
$tpl = new tplTemplatez('alternative.tpl');

for(
$i=0;$i<6;$i++){
   
    if(
$i == 2 || $i == 5) {
       
$tpl->tplSetNeeded('ROW/if_i_2');
    }
   
   
    if(
$i == 3 || $i == 4 || $i == 5) {
       
$tpl->tplSetNeeded('ROW/another_tr');
       
        if(
$i == 4)
           
$tpl->tplSetNeeded('ROW/two_td');
        else
           
$tpl->tplSetNeeded('ROW/one_td');
    }
   
   
//$tpl->tplAssign('var', $i); // assign variable
   
$array['var'] = $i; // anoter way to assign variable
   
   
$tpl->tplParse($array,'ROW'); // parse main dinamic block
}

$tpl->tplPrint(); // print the result
?>

For more information send a message to info at phpclasses dot org.