jeudi 5 novembre 2015

laravel 5 blade template prints html as text

Vote count: 0

I have <p><strong>Some Body Lement&nbsp;Some Body Lement</strong></p> In database. I want to print in blade as html. but it prints as text

enter image description here

In my blade I have

@foreach( $articles as $article )
    <div class="recommended-info"><h3>{{ $article['title'] }}</h3></div>
    {{ $article['body'] }}
@endforeach

asked 1 min ago
Anri
1,043

1 Answer

Vote count: 0

If you don't want to escape the HTML, then you need to use the {!! !!} syntax. Example:

@foreach( $articles as $article )
    <div class="recommended-info"><h3>{{ $article['title'] }}</h3></div>
    {!! $article['body'] !!}
@endforeach

answered just now

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



laravel 5 blade template prints html as text

Aucun commentaire:

Enregistrer un commentaire