Categories > TinyButStrong general >

Output multi array

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: sonsen
Date: 2007-05-30
Time: 14:30

Output multi array

Hi there,

none in the german forum, so I'll try it with my poor english... :-)

my array looks like this:

$test
|-+ 0 (array)
| |-> 0 = "1-farbig" (string)
| |-> 1 = "2-farbig" (string)
| |-> 2 = "3-farbig" (string)
| |-> 3 = "4-farbig" (string)
| |-> 4 = "5-farbig" (string)
| |-> 5 = "Kein Druck" (string)
|-+ 1 (array)
| |-> 0 = "1-farbig" (string)
| |-> 1 = "Kein Druck" (string)

this should be the output:

for different child arrays from array $test (-> in this cas 0 +1)

<tr>
<td width="93">Druck :</td>
<td width="180"><select size="1" name="color[array$i]" style="width:180px;"><option selected value="select print">Select Print</option>
<option value="[different colors;block=option]">differen colors from array[$i]</option>
     </td>
<td>[different (parent) arrays;block=tr]
</td>
</tr>

Maybe this is easy, but i didn't find the right solution the last hours...

Can someone provide me a hint?

Cheers
sonsen
By: Skrol29
Date: 2007-05-30
Time: 19:41

Re: Output multi array

Hi,

You can do this with block+subblocks.

<tr>
  Parent id = [par.$]
  <select>
    <option [col.val;block=option;p1=[par.$]>
  </select>
</tr>

PHP:
$TBS->MergeBlock(par,'array',$test);
$TBS->MergeBlock(par,'array','test[%p1%]'); // $test must be global

see here for more information:
  http://www.tinybutstrong.com/manual.php#html_block_subblock