Categories > TinyButStrong general >

sub template?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: PFPRO
Date: 2005-09-16
Time: 11:48

sub template?

guess i didn't got it at all...
i'm trying
to nest a select box with options
into each row of the main data...

where's my mistake?
thx in advance...


php:
$TBS = new clsTinyButStrong;
$TBS->LoadTemplate('templates/test.htm');
$country = array('France','England','Spain','Italy','Germany') ;
$fruits = array('a','b','c','d','e') ;
$TBS->MergeBlock('blk1',$country);
$TBS->MergeBlock('blk2',$fruits);
$TBS->Show();

template file:

<table cellpadding="2" cellspacing="0">
<tr>
  <td>[blk1.val;block=tr]</td>
  <td>
   <select>
    <option>[blk2.val;block=option]</option>
   </select>
  </td>
</tr>
</table>
By: Skrol29
Date: 2005-09-16
Time: 11:55

Re: sub template?

Hello,

You should merge blk2 first, then blk1.

In your script, blk1 is merged first, then you have sevral lignes containing several blk2 definitions. But when a block has several definitions, they are sections of the same block. So each part separating sections is deleted t the merging.
That's what explain your result.
By: PFPRO
Date: 2005-09-16
Time: 13:14

Re: sub template?

big up skrol29!
you're too fast... ;)
thx a lot