Tencent / Biny

Biny is a tiny, high-performance PHP framework for web applications
BSD 3-Clause "New" or "Revised" License
1.69k stars 258 forks source link

在tpl中有什么方法可以foreach $PRM #116

Closed ShigemoriHakura closed 4 years ago

ShigemoriHakura commented 4 years ago

还是说不建议在模板里面for数组=-=

billge1205 commented 4 years ago

可以的 直接用php语法就行

<?foreach ($PRM['xxx'] as $k => $v){?>
    <td><?=$v?></td>
<?}?>

不过现在php原生模板渲染用的不多了 基本都前后端分离了 php只返回json数据 然后页面都由前端自己渲染了

ShigemoriHakura commented 4 years ago

老懒人了.jpg 写js好麻烦啊