[ Index ]
 

Code source de PHP PEAR 1.4.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/docs/HTML_Template_IT/examples/ -> sample_it.php (source)

   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  $tpl->loadTemplatefile('main.tpl.htm', true, true);
  12  
  13  foreach ($data as $name) {
  14      foreach ($name as $cell) {
  15          // Assign data to the inner block
  16          $tpl->setCurrentBlock('cell');
  17          $tpl->setVariable('DATA', $cell);
  18          $tpl->parseCurrentBlock();
  19      }
  20      // Assign data and the inner block to the
  21      // outer block
  22      $tpl->setCurrentBlock('row');
  23      $tpl->parseCurrentBlock();
  24  }
  25  // print the output
  26  $tpl->show();
  27  ?>


Généré le : Sun Feb 25 14:08:00 2007 par Balluche grâce à PHPXref 0.7