Display Text(Html) Saved in Database Using Ckeditor

Display Text(HTML) Saved In Database using CkEditor

Just try to use

echo htmlspecialchars_decode($text);

And it will work .

text print with html tags saved from ckeditor to database

You need to remove HTML tag in the view file using the following way:

{!! $company_detail->company_description !!}



why ckeditor content stored in database do not display as html in php

Try this with php syntax like

{!! $blog->body !!}

Note: Make sure that your editor sending proper html content?

display ckeditor data saved in database in div tag

{!! $object->text !!}

string will auto escape when you'll use {{ }}

How to display ckeditor saved html data from database to normal text in MVC 5

When you use the Html.DisplayFor helper method, razor will encode the content before rendering. You should use Html.Raw() helper method which will not encode your content and pass the value you want to render directly to that.

<div class="panel-body">

Load html text from database to CKEDITOR for updating purpose

How does exactly look $data? Maybe you have to use htmlspecialchars_decode.

CKEditor displaying HTML tags in editor

It seems that CodeIgniter's func set_value() acts like htmlspecialchars() in some way. So if you are getting <any_tag> on CKEditor this workaround can help you. Change

$ck_editor->editor("sec1_content", set_value('sec1_content', html_entity_decode($default_value)), $config);

To this:

$ck_editor->editor("sec1_content", html_entity_decode(set_value('sec1_content', $default_value)), $config);


Put html_entity_decode around set_value. The reason for this is obviously because the set_value method might not use the $default_value parameter but return the posted data instead.

Related Topics

Leave a reply