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

Source for file ittest.php

Documentation is available at ittest.php

  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. ?>

Documentation generated on Tue, 10 Dec 2019 05:16:06 -0500 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.