2013-05-22 29 views
0

如何使用PHP設置CKEditor4值?我把變量放在標籤中,但是它沒有加載我從數據庫中抓取的數據。使用PHP設置CKEditor4值

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

有人能幫助我嗎?它是否屬於replace()函數,如Value:$ descriptionH或其他?

回答

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>