2011-01-25 11 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

私のコードではどこのテキストエリアが見つかりません...私のコードではありません..テキストエリアは動的に来ています...私はちょうどckeditorファイルを含む....私は何かが欲しい:http://ckeditor.com/demo –

+1

@dskanth質問を編集し、使用しているコードを追加してください。 –

+0

私の質問を編集....エディタをロードするコードを追加しました...現在、私が理解していないのは、デフォルトでエディタにいくつかのコンテンツをロードする方法です –

2

を参照してください、CKEditorバージョンの「編集者」の方法は、デフォルト値

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

ちょうど第二のパラメータにデフォルト値を渡すロードすることができます。

関連する問題