Heim  >  Artikel  >  Backend-Entwicklung  >  Smarty3.0 自定义函数,该如何解决

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

WBOY
WBOYOriginal
2016-06-13 10:21:39990Durchsuche

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这种写法是会报错的,因为核心库已经删除了这个方法,但是该方法依旧可以正常使用,[email protected]:
@$smarty->register_function('list','format_data');


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

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

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn