2011-01-25 118 views
1

iam在我的網站中使用ckeditor將內容添加到網頁中。 但我無法理解如何在ckeditor中獲取此內容以便稍後進行編輯...在ckeditor中編輯內容

如何將內容加載到ckeditor中? IAM使用以下代碼來加載編輯:

 
    if ([email protected]_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'); 
} 

回答

4

的一種方式是與適當的(htmlentities()處理)HTML內容到預先填充<textarea>字段。 CKEditor將自動獲取數據,並將其插入WYSIWYG編輯器。

Integration chapter in the developers guide

+0

但iam無法找到我的代碼中的textarea在哪裏...我沒有在我的代碼.. textarea是動態的...我只包括ckeditor文件....我想要的東西:http://ckeditor.com/demo – 2011-01-25 14:16:07

2

對於那些誰沒有找到答案,CKEditor的的「主編」的方法允許加載默認值

public function editor($name, $value = "", $config = array(), $events = array()) 

只是傳遞第二參數的默認值。