我正在使用ckeditor将一些html结构插入到db中。我首先使用代码视图将html结构粘贴到编辑器中,插入到mysql db之后,直到在网页上回显,html结构数据仍然保持。
然而,当同一数据被再次调用到相同的ckeditor进行更新时,结构被破坏,我发现ckeditor已经自动将html标签更改为代码,下面是一个提取: -
A)要粘贴到编辑器代码视图中的html代码,用于插入(好)
<a href="#">
<img src="../catalog/view/theme/default/images/services/b1.jpg" alt="" />
<div class="btn-gradient-yellow">Details
<div class="btn-arrow"></div>
</div>
<div class="cat-title-bg">
SERVICES
</div>
</a>
B)db数据(好)
<a href="#">
<img src="../catalog/view/theme/default/images/services/b1.jpg" alt="" />
<div class="btn-gradient-yellow">Details
<div class="btn-arrow"></div>
</div>
<div class="cat-title-bg">
SERVICES
</div>
</a>
C)从db(好)
调用的网页数据由html_entity_decode($ record [&#34; content&#34;],ENT_COMPAT,&#39; UTF-8&#39;)调用;
<a href="#">
<img src="/catalog/view/theme/default/images/services/b1.jpg" alt="" />
<div class="btn-gradient-yellow">Details
<div class="btn-arrow"></div>
</div>
<div class="cat-title-bg">
SERVICES
</div>
</a>
D)ckeditor中的代码视图,内容由上述数据填充(已更改)
由html_entity_decode($ record [&#34; content&#34;],ENT_COMPAT,&#39; UTF-8&#39;)调用;
<a href="#"><img alt="" src="../catalog/view/theme/default/images/services/b1.jpg" /></a>
<div class="btn-gradient-yellow"><a href="#">Details </a>
<div class="btn-arrow"> </div>
<a href="#"> </a></div>
<a href="#"> </a>
<div class="cat-title-bg"><a href="#">SERVICES</a></div>
如何让ckeditor不要对数据添加更改?