Ftable字段循环的时候 想分开循环用 if判断无效

迅睿框架 更新 2022-07-31 19:58:23 靠谱小青年


{php $mval = $t['canshu'];}

{loop $mval $v}


<td>{$v[1]}</td>

<td>{$v[2]}</td>


{/loop}


Ftable 字段  循环的时候  想 分开 循环 用 if 判断无效  谢谢


{php $mval = $t['canshu'];}

{loop $mval $v}


 {if $v==0}

<td>{$v[1]}</td>

<td>{$v[2]}</td>

{else}


<td class="hjk">{$v[1]}</td>

<td class="hjk">{$v[2]}</td>

{/if}


{/loop}



{php $mval = $t['canshu'];}

{loop $mval $v}


<td>{$v[1]}</td>

<td>{$v[2]}</td>


{/loop}

方案

  • 迅睿框架技术-岳老师 #1 · 2022-07-22 14:30:00
      {if $v==0}肯定是不能的,$v是数组,不能直接等于判断
  • 靠谱小青年 #2 · 2022-07-22 14:31:27
    迅睿框架技术-岳老师 那用什么 判断可以 实现呢 谢谢
  • 农村人 #3 · 2022-07-22 14:32:34
    {if in_array(0, $v)}
  • 靠谱小青年 #4 · 2022-07-22 14:37:19
    农村人 {php $mval = $t['canshu'];} {loop $mval $v} {if in_array(0, $v)} <td>{$v[1]}</td> <td>{$v[2]}</td> <td>{$v[3]}</td> <td>{$v[4]}</td> <td>{$v[5]}</td> {else} 11111 {/if} {/loop}这样吗 无效呢 哪里错了吗 谢谢
  • 老豆 #5 · 2022-07-22 15:02:12
    表示v1到v5,有一个是0的才显示
  • 小黄人 18html #6 · 2022-07-22 15:09:48
    满意答案
    <p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{php $mval = $t['canshu'];}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{loop $mval $k $v}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><br style="box-sizing: border-box;"/></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><span style="box-sizing: border-box; white-space: pre;">  </span>{if $k==0}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><td>{$v[1]}</td></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><td>{$v[2]}</td></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{else}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><br style="box-sizing: border-box;"/></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><td class="hjk">{$v[1]}</td></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><td class="hjk">{$v[2]}</td></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{/if}</p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;"><br style="box-sizing: border-box;"/></p><p style="box-sizing: border-box; margin-top: 0px; margin-bottom: 1rem; line-height: 25px; font-family: sans-serif; white-space: normal;">{/loop}</p>
  • 靠谱小青年 #7 · 2022-07-31 19:58:23
    @小黄人 18html:完美 完美

迅睿系统漏洞

CMS建站系统高级版
CMS建站系统高级版(2026-12-01)
用户权限页增加「初始化权限」 开启开发者模式后,前台栏目无权限提示会...
GeoSeo收录宝
GeoSeo收录宝(2026-12-01)
- 收录与推送 新增 抖音口令(列表可直接复制带参链接投放抖音) ...
GeoSeo工具箱
GeoSeo工具箱(2026-11-30)
新增内容创作工作台 优化CSS样式归集
分类信息
分类信息(2026-11-30)
分类信息把招聘、房产、二手、本地服务和商家收成同城门户。访客按开通城...
AI文章生成器
AI文章生成器(2026-11-30)
优化模型思考模式配置
小黄人工具箱
小黄人工具箱(2026-11-28)
新增模块列表栏目树功能
留言板
留言板(2026-11-28)
可用于在线留言,预约,反馈,询盘,后台可查看留言信息和审核
签到管理
签到管理(2026-11-27)
修复失效图标