Ko(mu)stache - multidimensional arrays

94 Views Asked by At

I have a table like this:

<table>
<?php foreach($var as $val): ?>
<tr>
<?php foreach($val as $row): ?>
<td> ... </td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
</table>

How can I code this with mustache?

1

There are 1 best solutions below

0
On BEST ANSWER

Assuming you're using the KOstache module, Kostache::factory() and assigning your multidimensional array in your controller. Then using an Implicit iterator to loop through all elements.