Rendering HTML Tags Laravel 5 Blade Templating -
i'm working on laravel app , displaying content database, datatype text
, content
<span style="font-weight: bold; font-style: italic;">what dog's name?</span>
as can see has html tags when rendered in view, instead of formatting text what dog's name?
displaying entire content
<span style="font-weight: bold; font-style: italic;">what dog's name?</span>
it's not reading html tag. there convertion need in formatting? when view source it,
<span style="font-weight: bold; font-style: italic;">what dog's name?</span>
here's code:
view
<table class="table table-striped table-bordered"> <tbody> @foreach($questions $key => $value) <tr> <td class="">{{ $value->question }}</td> </tr> @endforeach </tbody>
my controller:
public function create() { $questions = question::where('isenabled', '=', 'yes')->get(); return view('crm.create')->with(array('questions' => $questions)); }
you need tell blade not escape html using {!! !!}
nb: applicable if using laravel 5
@foreach($questions $key => $value) <tr> <td class="">{!! $value->question !!}</td> </tr> @endforeach
Comments
Post a Comment