php foreach标签的使用

1.控制器那边输出数据树到模板。

$this->assign('product_type_list',$product_type_list);


2.模板(HTML)中使用foreach标签对列表数据做页面展示。

<select id="TYPE_ID_EDIT" class="select2_single form-control" tabindex="-1">
    <foreach name="product_type_list" item="vo">
        <option value="{$vo[0]['TYPE_ID']}">{$vo[0]['TYPE_NAME']}</option>
    </foreach>
</select>


猜你喜欢

转载自blog.csdn.net/u014132947/article/details/80237459