HTML_Template_IT
[ class tree: HTML_Template_IT ] [ index: HTML_Template_IT ] [ all elements ]

Source for file sample_it.php

Documentation is available at sample_it.php

  1. <?php
  2. require_once 'HTML/Template/IT.php';
  3.  
  4. $data = array (
  5.     '0' => array('Stig''Bakken'),
  6.     '1' => array('Martin''Jansen'),
  7.     '2' => array('Alexander''Merz')
  8. );
  9.  
  10. $tpl = new HTML_Template_IT('./templates');
  11. $tpl->loadTemplatefile('main.tpl.htm'truetrue);
  12.  
  13. foreach ($data as $name{
  14.     foreach ($name as $cell{
  15.         // Assign data to the inner block
  16.         $tpl->setCurrentBlock('cell');
  17.         $tpl->setVariable('DATA'$cell);
  18.         $tpl->parseCurrentBlock();
  19.     }
  20.     // Assign data and the inner block to the
  21.     // outer block
  22.     $tpl->setCurrentBlock('row');
  23.     $tpl->parseCurrentBlock();
  24. }
  25. // print the output
  26. $tpl->show();
  27. ?>

Documentation generated on Mon, 11 Mar 2019 15:36:53 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.