검색 페이지에서 가격이 높거나 낮거나 낮은 순으로 레코드를 짧게하려고합니다 (변경 사항을 제출하는 양식 포함). 행사. 아래의 양식에 대한 코드입니다 :htmlspecialchars()는 매개 변수 1을 문자열로, array가 주어진 것으로 기대합니다. laravel
{!!Form::open(['route' => 'short','method' => 'GET', 'role' => 'search','class'=>'select-filters'])!!}
<input type="hidden" name="country" value="{{$country}}">
<input type="hidden" name="category" value="{{$category}}">
<input type="hidden" name="days" value="{{$days}}">
<select name="sort_price" id="sort-price" onchange="this.form.submit()">
<option value="" selected="">Sort by price</option>
<option value="lower">Lowest price</option>
<option value="higher">Highest price</option>
</select>
{!! Form::close() !!}
와 나는 같은 페이지에있는 값을 초기화 있지만 오류 htmlspecialchars() expects parameter 1 to be string, array given
제공했습니다 Request::only()
에서
@if(Request::only('country') != null)
{{$country = Request::only('country')}}
@else
{{ $country = null }}
@endif
@if(Request::only('category') != null)
{{$category = Request::only('category')}}
@else
{{ $category = null }}
@endif
@if(Request::only('days') != null)
{{$days = Request::only('days')}}
@else
{{ $days = null }}
@endif
값은 검색 폼에서 전달되는을 색인 페이지에. 언제 다이 덤프 :
{{dd(Request::only('country','category','days'))}}
I 어레이 형태의 수신 값을 발생
난 단지 하나 개의 인자를 전달할 경우에 개별 키 값 쌍 덤프 :
{{dd(Request::only('country'))}}
또는
{{dd(Request::only('category'))}}
또는
{{dd(Request::only('days'))}}
당신의 이름은 큰 따옴표없이 속성! –
죄송합니다. 죄송합니다. –