Gij*_*rts 1 javascript php ckeditor laravel-5
我正在构建一个简单的博客,但我想使用CKeditor作为博客消息,以便用户可以对博客消息进行一些设计.我之前从未使用过CKeditor,而且我对Laravel也有点新意.所以我设法将我的textarea转换为CKeditor字段,并且我还构建了一个存储博客帖子的函数.这不是问题,我在我的数据库和我的博客概述页面上看到了数据.
但是,CKeditor/Laravel显然会将CKeditor生成的标签存储在数据库中,并将它们显示为文本.如何像代码一样显示文本?
博客消息现在:
CKEDITOR
我的代码
形成
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label for="bericht">Nieuwsbericht <span class="required">*</span></label>
<textarea class="form-control" id="bericht" name="bericht" required></textarea>
</div>
</div>
</div>
<script type="text/javascript">
CKEDITOR.replace( 'bericht' );
</script>
Run Code Online (Sandbox Code Playgroud)
显示博客文章
<div class="blog-post">
<div class="row">
<div class="col-md-12">
<h1>{{ $blog->name }}</h1>
</div>
<div class="col-md-12">
<h3>{{ $blog->subtitel }}</h3>
</div>
<div class="col-md-12">
<p class="date">{{ $blog->created_at->formatLocalized('%A %d %B %Y') }}, Door {{$blog->user->name}}</p>
</div>
<div class="col-md-12">
<p class="blog-message">
{{ $blog->bericht }}
</p>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
小智 5
而不是{{ $blog->bericht }}尝试{!! $blog->bericht !!}
信息在这里:https://laravel-news.com/laravel-5-0-blade-changes