• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

php 搞代码 4年前 (2022-01-23) 13次浏览 已收录 0个评论

新手学习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

!本文来源gaodai.ma#com搞##代!^码网(

搞gaodaima代码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’);
最好把它写到公共文件里面


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:新手学习smarty 总是出现异常码
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址