Laravel刀片调试视图名称错误 [英] Laravel blade debug view name on error

查看:156
本文介绍了Laravel刀片调试视图名称错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当视图中有一些错误时,L4显示了一个很好的跟踪,但缓存的文件名:
打开:/ var / www / webpage / app / storage / views / 1154ef6ad153694fd0dbc90f28999013

when there is some error in view, L4 shows a nice trace, but cached filename: open: /var/www/webpage/app/storage/views/1154ef6ad153694fd0dbc90f28999013

如何在视图呈现到缓存保存视图的路径/名称(在评​​论或内容中)?
还是更好 - 在调试错误页面中显示它(被称为whoops或什么?)

howto during view-rendering-to-cache save view's path/name (in a comment or something)? Or better yet - to show it in the debug-error-page (its called whoops or something?)

谢谢;)

推荐答案

解决这个问题的一种方法是添加一个 html 注释(不是 一个,因为它们将不会在编译视图中呈现)在回显的部分。

One way to tackle this problem is add a html comments (not blade ones as they will not be rendered in compiled view) in sections which get echoed.

@section('content)

<!-- FILE: app/views/main/index.blade.php -->

<Your Content Goes Here>

@stop

这个html注释将在编译的风景。当然,您必须首先检查编译的视图,以确定哪个视图是有问题的视图。但是根据我的经验,这种方法几乎一直工作。

This html comment will get rendered in the compiled source of the view. Of course you will have to inspect the compiled view first to identify which view is the problematic one. But in my experience, this method work almost all the time.

这篇关于Laravel刀片调试视图名称错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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