简体   繁体   English

Ko(mu)stache-多维数组

[英]Ko(mu)stache - multidimensional arrays

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? 如何用小胡子编码?

Assuming you're using the KOstache module, Kostache::factory() and assigning your multidimensional array in your controller. 假设您正在使用KOstache模块, Kostache::factory()并在控制器中分配多维数组。 Then using an Implicit iterator to loop through all elements. 然后使用隐式迭代器遍历所有元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM