通知短信+运营短信,5秒速达,支持群发助手一键发送🚀高效触达和通知客户 广告
在index界面中 <th >栏目名称</th> <th width="5%">ID</th> <th width="10%">排序</th> <th>栏目类型</th> <th>父级名称</th> <th width="30%">操作</th> view部分的部署,视文档而定。这里是是列表页的一个展示。tp的volist就是使用foreach函数对读取数剧循环输出。 {volist name="cate" id="cate"} <tr> <td align="center">{$cate.id}</td> <td align="center">{$cate.sort}</td> <td>{if condition="$cate['level'] neq 0"}|{/if}<?php echo str_repeat('-', $cate['level']*4)?>{$cate.catename}</td> <td align="center"></td> <td align="center"> {if condition="$cate['pid'] eq 0"}<?php echo " "; ?> {elseif condition="$cate['pid'] neq 0"} <?php $name=db('cate')->where('id', $cate['pid'])->value('catename');echo $name; ?> {/if} </td> <td align="center"> <a href="{:url('edit',array('id'=>$cate['id']))}" class="btn btn-primary btn-sm shiny"> <i class="fa fa-edit"></i> 编辑 </a> <a href="#" onClick="warning('确实要删除吗', '{:url('del',array('id'=>$cate['id']))}')" class="btn btn-danger btn-sm shiny"> <i class="fa fa-trash-o"></i> 删除 </a> </td> </tr> {/volist}