用PHP设置CKEditor4值

时间:2013-05-22 12:04:44

标签: php ckeditor

如何使用PHP设置CKEditor4值?我把变量放在标签里面,但它没有加载我从数据库中抓取的数据。

<td class="rightpan">
<textarea name="editor1"><?=stripslashes($descriptionH); ?></textarea>
<script>
    CKEDITOR.replace( 'editor1', {
        removePlugins: 'elementspath' 
    });
</script>

有人能帮助我吗?它是属于replace()函数的东西,比如Value:$ descriptionH或者什么?

1 个答案:

答案 0 :(得分:0)

<td class="rightpan">
<textarea id="editor1" class="ckeditor" name="editor1"><?php echo htmlspecialchars($descriptionH, ENT_QUOTES); ?></textarea>
<script>
$('#editor1').ckeditor(function() {},
    {
        toolbar: [
            ['Source','Styles', 'Format','TextColor','BGColor'],
            ['Image','Table','HorizontalRule','SpecialChar','PageBreak'],
            ['Cut','Copy','Paste','PasteText','PasteFromWord','-','Scayt'],
            ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', '-', 'About'],
            ['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock']
        ],
        width: 650,
        height: 350
    }
);
</script>