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.  
  12. $tpl->loadTemplatefile("main.tpl.htm"truetrue);
  13.  
  14. foreach($data as $name{
  15.     foreach($name as $cell{
  16.         // Assign data to the inner block
  17.         $tpl->setCurrentBlock("cell";
  18.         $tpl->setVariable("DATA"$cell;
  19.         $tpl->parseCurrentBlock("cell";
  20.     }
  21.     // Assign data and the inner block to the
  22.     // outer block
  23.     $tpl->setCurrentBlock("row";
  24.     $tpl->parseCurrentBlock("row";
  25. }
  26. // print the output
  27. $tpl->show();
  28. ?>

Documentation generated on Mon, 11 Mar 2019 14:16:57 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.