smarty 调用php内置函数
来源:互联网 发布:北京折叠知乎 编辑:程序博客网 时间:2024/05/02 19:57
错误提示::syntax error: (secure mode) 'strstr' not allowed in if statement
smarty 默认if 判断里面只让用几个内置方法,除此之外的不让使用,所以添加上就可以了,
但是你更改完后,需要更新smarty的缓存才会生效
Smarty.class.php 文件的230行
var $security_settings = array( 'PHP_HANDLING' => false, 'IF_FUNCS' => array('array', 'list', 'isset', 'empty', 'count', 'sizeof', 'in_array', 'is_array', 'true', 'false', 'null','strstr'), // 此处添加你需要的php内置方法,smarty 是靠此处来判断是否让该方法可用 'INCLUDE_ANY' => false, 'PHP_TAGS' => false, 'MODIFIER_FUNCS' => array('count'), 'ALLOW_CONSTANTS' => false, 'ALLOW_SUPER_GLOBALS' => true);
模板里面这么写
<{if !strstr($data.pic,'http')}>逻辑,逻辑<{/if}>
我这是判断是否是远程图片
0 0
- smarty 调用php内置函数
- smarty 调用php内置函数
- smarty中调用php内置函数
- 在smarty中调用php的内置函数
- 在smarty中调用php内置函数的方法
- 在smarty中调用php的内置函数
- PHP模板引擎smarty的内置函数
- PHP模板引擎Smarty内置函数
- PHP模板学习--Smarty 内置函数
- 用了smarty两年多,才知道在模板中可以直接调用PHP内置函数
- smarty内置函数
- smarty内置foreach函数
- [转]smarty中调用php函数
- Smarty模板中调用PHP函数
- Smarty实例教程----实例篇(一、使用PHP内置MYSQL函数)
- smarty内置函数的使用
- Smarty模板技术-内置函数
- smarty调用php常量
- 写在前面的话
- Caused by: java.lang.NoSuchMethodError: javax.persistence.OneToMany.orphanRemoval()Z解决方案
- 搜索算法总结
- AndroidSDK requires Android Developer和android sdk更新失败的问题
- 解题报告 之 SGU242 Student's Morning
- smarty 调用php内置函数
- 【tcp-ip学习总结】一些常用的winsock API函数
- WIN7 Wireshark: There are no interfaces on which a capture can be done
- xshell和xmanger的注册码
- Fibonacci数列的c语言模块化测试程序
- 剑指offer 面试题4—替换字符串中空格
- listView隔行换色多选
- Git初识
- App适配iPhone 6/ Plus和iOS 8:10条小秘诀