home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / sample_it.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  679 b   |  29 lines

  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", true, true);
  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. ?>
  29.