【发布时间】:2015-09-12 02:08:37
【问题描述】:
我正在开发一个 Laravel 应用程序,我正在显示数据库中的内容,数据类型是 text,这就是内容
<span style="font-weight: bold; font-style: italic;">What is your dog's name?</span>
你可以看到它有 HTML 标签,但是当我在我的视图中呈现它时,而不是格式化文本 What is your dog's name? 它正在显示整个内容
<span style="font-weight: bold; font-style: italic;">What is your dog's name?</span>
它没有读取 HTML 标签。我需要在格式中进行转换吗?当我查看源代码时,
<span style="font-weight: bold; font-style: italic;">What is your dog's name?</span>
这是我的代码:
查看
<table class="table table-striped table-bordered">
<tbody>
@foreach($questions as $key => $value)
<tr>
<td class="">{{ $value->Question }}</td>
</tr>
@endforeach
</tbody>
我的控制器:
public function create()
{
$questions = Question::where('IsEnabled', '=', 'Yes')->get();
return view('crm.create')->with(array('questions' => $questions));
}
【问题讨论】:
标签: html laravel view rendering blade