lundi 26 février 2018

Laravel foreach loop scope

When i use Laravel blade file foreach loop variable scope is accessible in all file, instead of it should not be able to use at the end of endforeach loop.

@foreach($user->referral as $ref)
  <tr>
    <td></td>
    <td></td>
  </tr>
@endforeach

$ref: This variable accessible out of endforeach loop.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2BRAJmj
via IFTTT

Aucun commentaire:

Enregistrer un commentaire