在ckeditor中编辑内容
我在我的网站中使用 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'); }
iam using ckeditor in my website to add the content to the pages.
But I'm not able to understand how I get this content in ckeditor for editing it later...
How to load content into the ckeditor? Iam using the following code to load the editor:
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'); }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一种方法是使用适当的(
htmlentities()
已处理的)HTML 内容预填充请参阅开发人员指南中的集成章节
One way is to pre-populate the
<textarea>
field with the appropriate (htmlentities()
processed) HTML content. CKEditor will automatically fetch the data, and insert it into the WYSIWYG editor.See the Integration chapter in the developers guide
对于那些没有找到答案的人,ckeditor 的“编辑器”方法允许加载默认值,
只需在第二个参数中传递默认值即可。
For those who not found the answer, the "editor" method of ckeditor allow to load default value
Just pass your default value in the second parameters.