Home > Backend Development > PHP Tutorial > Smarty3.0 自定义函数,该如何解决

Smarty3.0 自定义函数,该如何解决

WBOY
Release: 2016-06-13 13:32:26
Original
1046 people have browsed it

Smarty3.0 自定义函数
程序运行没有问题,却提示:Notice: function call 'register_function' is unknown or deprecated. in E:\webphp\Smarty\sysplugins\smarty_internal_wrapper.php on line 57


这里为注册函数 $smarty->register_function('list','format_data');

找的其它资料说这是smarty2.0的特性,我现在用的是3.0,这个问题怎么解决,请高手指点。

------解决方案--------------------
3.0已经使用了另一种方法来取代他了,
要在 smarty/libs/plugins 下新建文件名方法
参考地址 http://www.gxcxy.com/thread-5259-1-1.html
您可以看看
------解决方案--------------------
关注中,哈哈
------解决方案--------------------
3.0这种写法是会报错的,因为核心库已经删除了这个方法,但是该方法依旧可以正常使用,前题是用@先抑制错误:
@$smarty->register_function('list','format_data');


技术支持:http://www.net920.cn http://www.ahthink.com

------解决方案--------------------
Smarty3.* 可以使用,$Smarty->registerPlugin()

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template