Im trying to use the if statement in blade template to show and hide section based on tab clicked. If I do ['no' =>'1']
, I get $name = 1
. but if I do ['no' =>'']
, it return nothing.How should I write to get $name = 1
with ['no' =>'']
?
web.php
Route::get('/welcome/{no}', function () {
return view('welcome',['no' =>'']);
});
welcome.blade.php
@if ($no == 1)
@include('post.article')
@else
@include('post.event')
@endif
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire