How to integrate ckfinder with ckeditor in codeigniter?

Member

by brandy , in category: PHP CMS , 8 months ago

How to integrate ckfinder with ckeditor in codeigniter?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by gilbert , 8 months ago

@brandy 

To integrate CKFinder with CKEditor in CodeIgniter, follow these steps:

  1. Download and extract CKFinder and CKEditor libraries into your CodeIgniter project directory.
  2. Open the CKEditor config file located at ckeditor/config.js and add the following code to enable CKFinder integration:
1
CKFinder.setupCKEditor(null, '/path/to/ckfinder/');


Replace /path/to/ckfinder/ with the actual path to the CKFinder directory within your project.

  1. Next, open the CKEditor configuration file located at ckeditor/config.js and add the following code to enable CKFinder file browser:
1
2
3
4
5
6
config.filebrowserBrowseUrl = '/path/to/ckfinder/ckfinder.html';
config.filebrowserImageBrowseUrl = '/path/to/ckfinder/ckfinder.html?type=Images';
config.filebrowserFlashBrowseUrl = '/path/to/ckfinder/ckfinder.html?type=Flash';
config.filebrowserUploadUrl = '/path/to/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
config.filebrowserImageUploadUrl = '/path/to/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images";
config.filebrowserFlashUploadUrl = '/path/to/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';


Replace /path/to/ckfinder/ with the actual path to the CKFinder directory within your project.

  1. Add the necessary routes to CodeIgniter's routes.php file to allow CKFinder access to the necessary PHP files:
1
2
$route['ckfinder'] = 'path_to_ckfinder';
$route['ckfinder/(.*)'] = 'path_to_ckfinder/$1';


Replace path_to_ckfinder with the path to the CKFinder directory within your project.

  1. Make sure to set the necessary permissions for the upload folders in CKFinder for the images and files that will be uploaded using CKEditor.
  2. Now you should be able to use CKFinder integrated with CKEditor in your CodeIgniter project. You can use the CKEditor in your views and the CKFinder file browser to upload and browse files.