Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Laravel ';错误异常';消息非法偏移量类型在isset中或为空_Laravel_Laravel 5.2 - Fatal编程技术网

Laravel ';错误异常';消息非法偏移量类型在isset中或为空

Laravel ';错误异常';消息非法偏移量类型在isset中或为空,laravel,laravel-5.2,Laravel,Laravel 5.2,我是拉威尔的新手。我试图在我的视图中显示错误,但我得到一个错误: 错误异常,消息“isset中的偏移量类型非法或为空” 以下是我的错误逻辑: @foreach(['success'=>'check','info'=>'感叹号圈','warning'=>'warning','danger'=>'ban']作为$type=>$icon) @if(会话::has($type)) {{Session::get($type)} @恩迪夫 @endforeach @如果(计数($errors)>0) @fo

我是拉威尔的新手。我试图在我的视图中显示错误,但我得到一个错误:

错误异常,消息“isset中的偏移量类型非法或为空”

以下是我的错误逻辑:

@foreach(['success'=>'check','info'=>'感叹号圈','warning'=>'warning','danger'=>'ban']作为$type=>$icon)
@if(会话::has($type))
{{Session::get($type)}
@恩迪夫
@endforeach
@如果(计数($errors)>0)
@foreach($errors->all()作为$index=>$message)
{{$message}}
@endforeach
@恩迪夫

我做错了什么?

您的视图代码看起来很好,因此问题可能来自其他地方(可能您正在以不同于预期的格式向视图传递数据),因此请编辑您的问题,以包含错误的完整堆栈跟踪。