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

Source for file tpl1.php

Documentation is available at tpl1.php

  1. <?php
  2.  
  3. include_once 'HTML/Template/PHPLIB.php';
  4. include_once 'Benchmark/Timer.php';
  5.  
  6. /**
  7. * "keep" = keep unknown template variables,
  8. * "remove" = remove 'em,
  9. * "comment" = put them into comments
  10. *
  11. * use keep if you have stylesheets or JavaScript
  12. * in your HTML code since those are also using
  13. * { and } which will then get removed.
  14. */
  15. $t =new HTML_Template_PHPLIB("./""keep");
  16. $timer =new Benchmark_Timer();
  17. $timer->start();
  18.  
  19. $t->setFile(array(
  20.     "main" => "tpl1.ihtml"
  21. ));
  22.  
  23. $welcome "Welcome to the real world";
  24.  
  25. $t->setVar(array(
  26.     "TITLE" => "This is my title",
  27.     "BGCOLOR" => "#cccccc",
  28.     "CONTENT" => $welcome
  29. ));
  30.  
  31. /**
  32. * or, use: $t->pparse("out", array("main"));
  33. */
  34. $t->parse("out"array("main"));
  35. $t->p("out");
  36. $timer->stop();
  37. $timer->display();
  38. ?>

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