Reputation: 45
In the laravel framework we can use blade to add PHP code in html file.
We are using both {{-- --}}
and {!! !!}
syntax in blade files of Laravel framework .
What is the basic difference between them?
Upvotes: 0
Views: 228
Reputation: 2495
{{-- --}}
is to create comments in your blade files.
{!! !!}
is for displaying data without escaping it.
You can read about those in the laravel docs:
https://laravel.com/docs/5.8/blade#comments https://laravel.com/docs/5.8/blade#displaying-data
Upvotes: 1
Reputation: 1128
{{-- This comment will not be present in the rendered HTML --}}
{!! it is used for escape html while rendering !!}
Upvotes: 0
Reputation: 9171
The first {{-- --}}
is used for Blade comments, it will not be displayed in HTML.
The second {!! !!}
is used to display unescaped data.
Upvotes: 0
Reputation: 164
{{-- --}}
is used to include comments, {!! !!}
is used to display a variable without escaping it, for example to display html content.
Upvotes: 1