From: Leandro Lucarella Date: Sun, 6 Jul 2003 04:55:57 +0000 (+0000) Subject: - Improved example. X-Git-Tag: 1.0.0beta1^0 X-Git-Url: https://git.llucax.com/software/bife/hit.git/commitdiff_plain/0e4906ac5ffa86bab5bcb74843e096579024c835 - Improved example. - Added a ROADMAP. - Updated package.xml. --- diff --git a/ROADMAP b/ROADMAP new file mode 100644 index 0000000..7f94e08 --- /dev/null +++ b/ROADMAP @@ -0,0 +1,7 @@ +$Id$ + + +Version 1.0.0 +============= + - Write some documentation. + diff --git a/examples/hooks/body.tpl.html b/examples/hooks/body.tpl.html new file mode 100644 index 0000000..2c564a6 --- /dev/null +++ b/examples/hooks/body.tpl.html @@ -0,0 +1,10 @@ + + + {TITLE} + + + {LINK} +
+ {BODY} + + diff --git a/examples/hooks/link.tpl.html b/examples/hooks/link.tpl.html new file mode 100644 index 0000000..fcce3df --- /dev/null +++ b/examples/hooks/link.tpl.html @@ -0,0 +1 @@ +{NAME} diff --git a/examples/hooks/table/body.tpl.html b/examples/hooks/table/body.tpl.html new file mode 100644 index 0000000..d6c8132 --- /dev/null +++ b/examples/hooks/table/body.tpl.html @@ -0,0 +1,3 @@ + + {ROWS} +
diff --git a/examples/hooks/table/cell.tpl.html b/examples/hooks/table/cell.tpl.html new file mode 100644 index 0000000..d4889a9 --- /dev/null +++ b/examples/hooks/table/cell.tpl.html @@ -0,0 +1 @@ +{CELL} diff --git a/examples/hooks/table/row.tpl.html b/examples/hooks/table/row.tpl.html new file mode 100644 index 0000000..2889643 --- /dev/null +++ b/examples/hooks/table/row.tpl.html @@ -0,0 +1 @@ +{ROW} diff --git a/examples/index.php b/examples/index.php index 0e6aa25..ba7c74e 100644 --- a/examples/index.php +++ b/examples/index.php @@ -1,5 +1,5 @@ -parseBuffered('cell', 'CELL', "$i,$j"); +// If not, we make a table using the template {{{ +} else { + $hit->pushGroup('table'); + for ($i = 0; $i < 20; $i++) { + for ($j = 0; $j < 20; $j++) { + $hit->parseBuffered('cell', 'CELL', "$i,$j"); + } + $hit->parseBuffered('row', 'ROW', $hit->popBuffer('cell')); } - $hit->parseBuffered('row', 'ROW', $hit->popBuffer('cell')); + $body = $hit->parse('body', 'ROWS', $hit->popBuffer('row')); + $hit->popGroup('table'); } +// }}} + +// Now a link, to look at the source or to look at the results {{{ +if (@$_REQUEST['s']) { + $link = $hit->parse('link', array('NAME' => 'View results', 'PAGE' => '?s=0')); +} else { + $link = $hit->parse('link', array('NAME' => 'View source', 'PAGE' => '?s=1')); +} +// }}} + +// We put all in the body and prints it {{{ echo $hit->parse( 'body', array( - 'ROWS' => $hit->popBuffer('row'), - 'TITLE' => 'HOLA MUNDO!!!', + 'TITLE' => 'HELLO WORLD!!!', + 'BODY' => $body, + 'LINK' => $link, ) ); +// }}} ?> diff --git a/package.xml b/package.xml index 310e656..d529900 100644 --- a/package.xml +++ b/package.xml @@ -3,9 +3,9 @@ HTML_Template_HIT Hooks vs IT Template Engine - HIT is a simple, ultra fast template engine. It's based on -a personal experiment called Hooks and IT Templates. It doesn't support blocks -like IT so every chunk must be in a separated file if you want to iterate it. + HIT is a simple, fast template engine. It's based ona a personal +experiment called Hooks and IT Templates. It doesn't support blocks like IT +so every chunk must be in a separated file if you want to iterate it. GPL @@ -21,7 +21,7 @@ like IT so every chunk must be in a separated file if you want to iterate it. 1.0.0beta1 2003-06-30 beta - Check http://www.llucax.hn.org/desarrollo/bife/ for details. + Check http://bife.llucax.hn.org/ for details. @@ -31,8 +31,12 @@ like IT so every chunk must be in a separated file if you want to iterate it. index.php body.tpl.html - cell.tpl.html - row.tpl.html + link.tpl.html + + body.tpl.html + cell.tpl.html + row.tpl.html +