模板 if condition 不能正确使用 strpos 语法

浏览:3479 发布日期:2014/06/16 分类:求助交流 关键字: 模板 if_condition
根据TP 3.2.2手册,模板中 if 标签可以在condition属性里面使用php代码,例如:

<if condition="strtoupper($user['name']) neq 'THINKPHP'">ThinkPHP
<else /> other framework
</if>

但是我尝试在使用strpos ,却不起作用。比如

<if condition="strpos('P1', 'P') eq 0">ThinkPHP
<else /> other framework
</if>

请各位同学指点。
最佳答案
评论( 相关
后面还有条评论,点击查看>>