Re: yet another template
| From: | Wolfram Kriesing | Date: | Wed, 07 Nov 2001 18:00:28 +0000 |
| Subject: | Re: yet another template | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-2609@lists.php.net to get a copy of this message | ||
> > $tpl['blockname']['value'] = $string;
>
> I like the idea of an object/xml compatible structure.
>
> How would you integrate the template system with databases?
do you mean the following?
$res = $db->getAll( "SELECT col1,col2,col3 FROM table" );
$tpl['block1'] = $res;
where the template is like this (ITX-syntax)
<!-- BEGIN block1 -->
col1: {col1}
col2: {col2}
col3: {col3}
<!-- END block1 -->
that would mean what i had written before was not entirely correct
$tpl['blockname']['value'] = $string;
OR
$tpl['blockname'] [ ] ['value'] = $string;
could be the right syntax depending if the block is meant as a loop,
which mostly is the case
--
Wolfram