欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

新手学习smarty 总是出现异常码

程序员文章站 2022-06-05 19:35:58
...
新手学习smarty 总是出现错误码
我做的自定义函数,plugins文件夹下的function.函数名.php 里面定义的函数是smarty_function_函数名($参数,&$smarty){函数体} 在做模板中引用 为什么总是提示我一堆看不懂的错误
Fatal error: Smarty error: [in php3.tpl line 1]: syntax error: unrecognized tag 'haibincn' (Smarty_Compiler.class.php, line 590) in D:\myev\apache\htdocs\smarty\libs\Smarty.class.php on line 1095

haibincn为我定义的标签 我用注册的方式都可以通过


另外请高手指点一下 我的smarty 第一次总都是出错
Warning: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in D:\myev\apache\htdocs\smarty\libs\Smarty_Compiler.class.php on line 400
按F5刷新后不会出现上面的错误码 但改了模板后 双会出现!!!

求高手大虾米指点 谢谢

------解决方案--------------------
使用时间函数的时候没有设置好时区,在文件前面 写上 date_default_timezone_set('UTC');
最好把它写到公共文件里面
新手学习smarty 总是出现异常码

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频