使用Smarty模板2.x注入变量报错
来源:互联网 发布:红色鸡蛋花有毒吗 知乎 编辑:程序博客网 时间:2024/05/16 07:18
原因:
php5.5以后的preg_replace不再支持e模式修饰符,可以用preg_replace_callback函数替换。
解决办法:
找到文件 Smarty_Compiler.class.php 第270行:
/* replace special blocks by "{php}" */$source_content = preg_replace($search.'e', "'" . $this->_quote_replace($this->left_delimiter) . 'php' . "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'" . $this->_quote_replace($this->right_delimiter) . "'" , $source_content);
替换为:
// 解决:preg_replace(): The /e modifier is deprecated, use preg_replace_callback ins$source_content = preg_replace_callback($search, create_function ('$matches', "return '" . $this->_quote_replace($this->left_delimiter) . 'php' . "' . str_repeat(\"\n\", substr_count('\$matches[1]', \"\n\")) .'" . $this->_quote_replace($this->right_delimiter) . "';") , $source_content);
转载自:http://www.epooll.com/archives/791/
0 0
- 使用Smarty模板2.x注入变量报错
- smarty模板config_load使用报错原因
- smarty模板引擎_2-变量的使用
- 【smarty】smarty模板变量调节器
- Smarty模板技术-Smarty变量
- smarty模板变量
- smarty模板变量调节器
- smarty模板的插件使用报错问题(已解决)
- smarty模板中的保留变量
- Smarty模板技术-变量调节器
- Smarty模板使用
- smarty模板使用
- Yii使用smarty模板
- smarty模板使用入门
- Smarty模板使用
- smarty模板的使用
- eaccelerator+PHP5.4导致smarty更新模板500报错
- smarty中使用变量
- 爱在云南,恋上丽江
- Linux epoll详解
- Chason NoHttp框架的使用。
- ORB特征
- [UnityShader3]波浪效果
- 使用Smarty模板2.x注入变量报错
- 首届华为开发者大赛沙龙牵手大连-与开发者共话赛事
- 导游【并查集】
- IOS用CGContextRef画各种图形(文字、圆、直线、弧线、矩形、扇形、椭圆、三角形、圆角矩形、贝塞尔曲线、图片)
- 深入理解Java虚拟机--内存分配规则
- 开始我的进阶之路
- 程序中umask(0)的意思?
- 大型网站架构演化
- 将pdf在线转换成图片格式的方法