[英]How to integrate CKFinder with CKEditor in CodeIgniter?
我研究了這個,我發現了許多集成CKEditor的方法,但是我在整合CKFinder時遇到了麻煩。 我的網站是由其他人創建的,但我覺得我可以自己整合。
該網站包含文章,我有一個使用CKEditor的“視圖”。 它工作得很好但我無法將圖像上傳到服務器或瀏覽服務器圖像以在CKEditor中插入照片。 所以我無法在文章文本中添加照片。 我希望CKFinder能解決這個問題。
我已經上傳了CKFinder文件並將它們放在與CKEditor相同的位置。 在我的addcontent.php中,我在頭文件中聲明了CKEditor代碼。
<script src="<?php echo base_url(); ?>plugins/ckeditor/ckeditor.js"></script>
這是ckeditor textarea:
<div class="form-group">
<label>Content Text</label>
<textarea class="form-control" id="description" name="text" rows="3"></textarea><div id="des_error" class="text-danger"></div>
</div>
這是ckeditor功能:
<script type="text/javascript">
$(function () {
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace('description');
//bootstrap WYSIHTML5 - text editor
$(".textarea").wysihtml5();
如果我在標題中聲明ckfinder如下:
<script src="<?php echo site_url(); ?>plugins/ckfinder/ckfinder.js"></script>
如何修改代碼以允許CKFfinder與CKEditor一起使用,以便我可以在文章文本中瀏覽和上傳文件?
作為旁注,我沒有看到任何控制器中定義的CKEditor。
您可以使用responsivefilemanager: https : //www.responsivefilemanager.com/#download-section
<script> CKEDITOR.replace('description', { filebrowserBrowseUrl: '<?php echo base_url();?>filemanager/dialog.php?type=2&editor=ckeditor&fldr=', filebrowserUploadUrl: '<?php echo base_url();?>filemanager/dialog.php?type=2&editor=ckeditor&fldr=', filebrowserImageBrowseUrl: '<?php echo base_url();?>filemanager/dialog.php?type=1&editor=ckeditor&fldr=' }); </script>
您應該在filemanager \\ config \\ config.php中更改配置文件
upload_dir' => '/uploadfilemanager/source/', //Upload folder
'thumbs_base_path' => '../thumbs/', //Thumbnail folder
'current_path' => '../source/', // The current path that you're using CKEditor
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.