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

降低laravel的报错级别

WBOY
Release: 2016-06-06 20:17:04
Original
1628 people have browsed it

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

回复内容:

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

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

使用array_get($arr,'src')

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template