- Forums
- laravel
- Laravel Blade Engine Foreach Loop Format Example Code
this is an example code you can use when you are using laravel blade template engine and use this format [4606], Last Updated: Mon Jun 24, 2024
agurld343w
Wed Oct 26, 2016
0 Comments
491 Visits
this is just an example code when you need to use the blade engine text format
@foreach
<!-- example: $string = '<b>webune</b>'; -->
<li>{!! $string !!}</li> <!-- OUTPUT: webune -->
{{ $string }} <!-- OUTPUT: <b>webune</b> --> <!-- uses htmlentities() -->
@endforeach
note, if you are going to be using a javascript framework like angularjs, you should use an expression such as:
@{!! $string !!}