【发布时间】:2017-02-02 20:08:57
【问题描述】:
我有这个网址:
http://test.dev/search?publishing_types[]=Selling&priceFrom=0&priceTo=300000&areaFrom=0&areaTo=300000&floors[]=2&yearFrom=1900&yearTo=2017
现在我想要的是这样的:
<input type="checkbox" class="preventUncheck" name="publishing_types[]" id="toggle-on{{ $index }}" value="{{ $prop_type }}" @if (publishg_types== Selling) {!! "checked" !!} @endif >
<input type="checkbox" class="preventUncheck" name="publishing_types[]" id="toggle-on{{ $index }}" value="{{ $prop_type }}" @if (publishg_types== Reng) {!! "checked" !!} @endif >
所以我想要检查复选框,如果 publishing_types == Selling 和/或 publishing_types == Rent 从 url 检查复选框
【问题讨论】:
-
如果你将
$request['NAME']传递给你的方法,你可以简单地使用它,否则你必须传递它 -
在视图中我收到此错误然后未定义变量:请求
-
将
request()-helper 函数与request('publishing_types')一起使用 -
是的,在视图中你必须像@Sebastian 所说的那样使用
request()函数
标签: laravel laravel-5 laravel-5.2