Home  >  Article  >  Backend Development  >  降低laravel的报错级别

降低laravel的报错级别

WBOY
WBOYOriginal
2016-06-06 20:17:041604browse

laravel 在blade模板中如果引用了数组中不存在的一个元素,比如$a['src'],程序就会报致命错误,这敏感度也太高了吧,有什么设置能忽略这种错误么

回复内容:

laravel 在blade模板中如果引用了数组中不存在的一个元素,比如$a['src'],程序就会报致命错误,这敏感度也太高了吧,有什么设置能忽略这种错误么

首先我觉得这种设置蛮不错的,有错误就应该暴露出来
其次也是可以改的,不过要改laravel源码,laravel4、laravel5的改起来又不同,
除非你确定不会更新laravel

使用array_get($arr,'src')

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