I am using Laravel 4.
I am ready to display text only if my request does not contain input
For example, I have a list of products mysite/products, and I have an input field for filtering by price, which gives the following URL after clicking:mysite/products?price=true
I can use if(Input::has('price'))to check if I have this input, but the fact is that I have a bunch of input fields, and I would like to display text only when there are no inputs.
I am thinking of something like:
@if(Input::has('price')||Input::has('mixed')||Input::has('male')||Input::has('female')||Input::has('kid')||Input::has('page'))
@else
@endif
But in a simplified way ...
I thought to check URi with Request::segment(1)and see if it matches with 'products', but it works even with active inputs.
source
share