Home  >  Article  >  Backend Development  >  新手学习smarty 总是出现异常码

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

WBOY
WBOYOriginal
2016-06-13 10:14:21803browse

新手学习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');
最好把它写到公共文件里面

Statement:
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