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

Source for file authors.php

Documentation is available at authors.php

  1. <?php
  2. //we want to display this author list
  3. $authors = array(
  4.     'Christian Weiske'  => 'cweiske@php.net',
  5.     'Björn Schotte'     => 'schotte@mayflower.de'
  6. );
  7.  
  8. require_once 'HTML/Template/PHPLIB.php';
  9. //create template object
  10. $t =new HTML_Template_PHPLIB(dirname(__FILE__)'keep');
  11. //load file
  12. $t->setFile('authors''authors.tpl');
  13. //set block
  14. $t->setBlock('authors''authorline''authorline_ref');
  15.  
  16. //set some variables
  17. $t->setVar('NUM_AUTHORS'count($authors));
  18. $t->setVar('PAGE_TITLE''Code authors as of ' date('Y-m-d'));
  19.  
  20. //display the authors
  21. foreach ($authors as $name => $email{
  22.     $t->setVar('AUTHOR_NAME'$name);
  23.     $t->setVar('AUTHOR_EMAIL'$email);
  24.     $t->parse('authorline_ref''authorline'true);
  25. }
  26.  
  27. //finish and echo
  28. echo $t->finish($t->parse('OUT''authors'));
  29. ?>

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