Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 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
?>