2 // vim: set expandtab tabstop=4 shiftwidth=4 foldmethod=marker:
3 // +--------------------------------------------------------------------+
4 // | BIFE - Buil It FastEr |
5 // +--------------------------------------------------------------------+
6 // | This file is part of BIFE. |
8 // | BIFE is free software; you can redistribute it and/or modify it |
9 // | under the terms of the GNU General Public License as published by |
10 // | the Free Software Foundation; either version 2 of the License, or |
11 // | (at your option) any later version. |
13 // | BIFE is distributed in the hope that it will be useful, but |
14 // | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 // | General Public License for more details. |
18 // | You should have received a copy of the GNU General Public License |
19 // | along with Hooks; if not, write to the Free Software Foundation, |
20 // | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 // +--------------------------------------------------------------------+
22 // | Created: miƩ jun 18 01:05:57 ART 2003 |
23 // | Authors: Leandro Lucarella <luca@lugmen.org.ar> |
24 // +--------------------------------------------------------------------+
29 // This is a simple test and example of HTML_Template_HIT
32 ini_set('include_path', '../src:'.ini_get('include_path'));
34 require_once 'HTML/Template/HIT.php';
35 $hit =& new HTML_Template_HIT('hooks');
38 // Looks if we want to show the source {{{
39 if (@$_REQUEST['s']) {
40 $body = highlight_file($_SERVER['SCRIPT_FILENAME'], true);
43 // If not, we make a table using the template {{{
45 $hit->pushGroup('table');
46 for ($i = 0; $i < 20; $i++) {
47 for ($j = 0; $j < 20; $j++) {
48 $hit->parseBuffered('cell', 'CELL', "$i,$j");
50 $hit->parseBuffered('row', 'ROW', $hit->popBuffer('cell'));
52 $body = $hit->parse('body', 'ROWS', $hit->popBuffer('row'));
53 $hit->popGroup('table');
57 // Now a link, to look at the source or to look at the results {{{
58 if (@$_REQUEST['s']) {
59 $link = $hit->parse('link', array('NAME' => 'View results', 'PAGE' => '?s=0'));
61 $link = $hit->parse('link', array('NAME' => 'View source', 'PAGE' => '?s=1'));
65 // We put all in the body and prints it {{{
69 'TITLE' => 'HELLO WORLD!!!',