禁用smarty通知 [英] disable smarty notice

查看:122
本文介绍了禁用smarty通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



确切地说:


注意:未定义变量:xy


因为我知道一些变量是未定义的,在某些情况下我甚至不想来定义它们。

但我不想禁用其他PHP通知。



感谢您的帮助!

解决方案

您应该使用这个: http://www.smarty.net/docs/en/variable.error.reporting.tpl

只要设定

  $ smarty-> error_reporting = E_ALL& 〜E_NOTICE; 


I would like to disable smarty-s notices.

This exactly:

Notice: Undefined variable: xy

Because I know that some variables are undefined and in some cases I don't even want to define them.

BUT I don't want to disable other PHP notices.

Thanks for help!

解决方案

You should use this: http://www.smarty.net/docs/en/variable.error.reporting.tpl

Just set

$smarty->error_reporting = E_ALL & ~E_NOTICE;

这篇关于禁用smarty通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆