CKEditor 4.x replaceClass不起作用

时间:2016-03-19 10:38:05

标签: cakephp-2.0 ckeditor4.x

我有几个问题CKEditor 4.x问题,这是最重要的问题。我试图通过replaceClass功能在我自己的CakePHP cms系统中实现CKEditor,但它似乎对我不起作用。

这就是我的HTML textarea的样子:

<div class="form-group required">
    <label for="PostContent">Content</label>
    <textarea name="data[Post][content]" class="ckeditor" rows="10" cols="30" id="PostContent" required="required"></textarea>
</div>

具有自定义配置的javascript文件:

<script type="text/javascript" src="/coaster_cms/js/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/coaster_cms/js/ckeditor/config_custom.js"></script>

自定义CKEditor配置(config_custom.js):

CKEDITOR.replaceClass('ckeditor', {
    language: 'nl',
    height: '400px',
    // speciale karakters niet escapen
    resize_enabled: false,
    entities_latin: false,
    entities_greek: false,
    entities: false,
    basicEntities: false
});

最奇怪的是,当我使用&#34; CKEDITOR.replace&#34;在id级别上这样:

CKEDITOR.replace('PostContent', {
    language: 'nl',
    height: '400px',
    // speciale karakters niet escapen
    resize_enabled: false,
    entities_latin: false,
    entities_greek: false,
    entities: false,
    basicEntities: false
});

提前感谢您分析代码并支持我;)

1 个答案:

答案 0 :(得分:1)

根据文档,replaceclass只接受一个字符串,而ckeditor是默认的。

http://docs.ckeditor.com/source/themedui.html#CKEDITOR-cfg-replaceClass