我在我的网站上使用ckeditor将内容添加到页面中。 但是我无法理解我是如何在ckeditor中获取这些内容以便以后编辑的...
如何将内容加载到ckeditor中?我使用以下代码加载编辑器:
if ( !@file_exists( '../../ckeditor/ckeditor.php' ) ) { if ( @file_exists('../../ckeditor/ckeditor.js') || @file_exists('../../../ckeditor/ckeditor_source.js') ) printNotFound('CKEditor 3.1+'); else printNotFound('CKEditor'); } include_once '../../ckeditor/ckeditor.php'; include_once '../../ckfinder/ckfinder.php'; // This is a check for the CKEditor class. If not defined, the paths in lines 57 and 70 must be checked. if (!class_exists('CKEditor')) { printNotFound('CKEditor'); } else { $ckeditor = new CKEditor(); $ckeditor->basePath = '../../ckeditor/'; $ckfinder = new CKFinder(); $ckfinder->BasePath = '../../ckfinder/'; // Note: BasePath property in CKFinder class starts with capital letter $ckfinder->SetupCKEditorObject($ckeditor); $ckeditor->editor('message'); }
答案 0 :(得分:4)
一种方法是使用适当的(<textarea>
已处理的)HTML内容预填充htmlentities()
字段。 CKEditor将自动获取数据,并将其插入WYSIWYG编辑器。
答案 1 :(得分:2)
对于那些没有找到答案的人,ckeditor的“编辑器”方法允许加载默认值
public function editor($name, $value = "", $config = array(), $events = array())
只需在第二个参数中传递默认值。