php - Laravel Blade using if condition inside foreach -



php - Laravel Blade using if condition inside foreach -

here code ..

@foreach (session::get('show_my_data') $key1 => $value1) <div class="sb_li"> <input id="sb_system_input_{{ $value1->myid }}" class="fr_cap" type="text" disabled name="fr_cap[{{ $value1->myid }}]" value="{{ $value1->frcapacity }}" maxlength="127"/> </div> @foreach ($m002_siteinfo $key => $value) @if({{!$value1->name}}) <div class="sb_li"> <input id="sb_system_input_{{ $value->myid }}" class="fr_cap" type="text" disabled name="fr_cap[{{ $value->myid }}]" value="" maxlength="127"/> </div> @endif @endforeach @endforeach

i trying display values of second foreach not there in first foreach using if condition in middle, iam getting syntax error in laravel ,blade templete.. ways prepare this??

you don't need {{ }} syntax within @if

you can write

@if(!$value1->name)

php laravel laravel-4 laravel-3 blade

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -