PHP Classes

File: nested.php

Recommend this page to a friend!
  Classes of Evgeny   tplTemplatez   nested.php   Download  
File: nested.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: 20 years ago
Size: 661 bytes
 

Contents

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

// arrays with data
$array = array(
array(
'value' => 'value1', 'caption' => 'caption1'),
array(
'value' => 'value2', 'caption' => 'caption2'),
array(
'value' => 'value3', 'caption' => 'caption3'),
);


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

for(
$i=0;$i<6;$i++){
   
   
// parsing for nested checkbox block
   
foreach ($array as $k => $v) {
       
$tpl->tplParse($v, 'ROW/row_checkbox'); // parse nested
   
}
   
$tpl->tplSetNested('ROW/row_checkbox'); // call it after parsing nested block
   
   
$tpl->tplParse('','ROW'); // parse main dinamic block
}

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