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

  1. <?php
  2. include_once 'HTML/Template/IT.php';
  3. include_once 'Benchmark/Timer.php';
  4.  
  5. $articles = array(
  6.         "ISBN345624345" => "Matrix 2",
  7.         "ISBN45df32342" => "Roger Rabbit",
  8.         "ISBN305632232" => "foo bar",
  9.         "ISBN674589123" => "Joe user's adventures"
  10. );
  11.  
  12.  
  13. $t =& new HTML_Template_IT("./");
  14. $timer =& new Benchmark_Timer();
  15. $timer->start();
  16.  
  17. $t->loadTemplateFile("block.ihtml",true,true);
  18. $t->setVariable(array(
  19.         "TITLE" => "This is a block integrated into another template",
  20.         "BGCOLOR" => "#cccccc",
  21.         "BLOCKER" => "block"
  22. ));
  23.  
  24. foreach ($articles as $k => $v) {
  25.     $t->setCurrentBlock("articlerow");
  26.     $t->setVariable("ID", $k);
  27.     $t->setVariable("ANAME", $v);
  28.     $t->parseCurrentBlock("articlerow");
  29. }
  30. $t->show();
  31. $timer->stop();
  32. $timer->display();
  33. ?>
  34.