A Laravel 3.x bundle for integrating CKEditor in your applications.
CKEditor Bundle allows you to generate CKEditor rich text boxes for your Laravel applications.
######1. Install using Artisan CLI:
php artisan bundle:install ckeditor
######2. Add the following line to application/bundles.php file:
return array('ckeditor' => array('auto' => true),);
######3. Add the following to the application.php config file in the 'aliases' array:
'CKEditor' => 'CKEditor\\CKEditor',
######4. Publish the bundle assets to your public folder:
php artisan bundle:publish
######To create a super simple rich text box:
$ckeditor = new CKEditor(); $ckeditor->editor('editorName');
######To create a more advanced rich text box:
$ckeditor = new CKEditor(); $config = array(); $config['toolbar'] = array( array( 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike' ), array( 'Image', 'Link', 'Unlink', 'Anchor' ) ); $events['instanceReady'] = 'function (ev) { alert("Loaded: " + ev.editor.name); }'; $ckeditor->editor("field1", "Initial value.
", $config, $events);
If anyone wants to call an instance of the ckeditor statically then whom ever who has the knowledge and time and willing to do so can submit a pull-request when he/she has modified the ckeditor php class for those things. I however am not bothered by doing '$myeditor = new CKEditor();', and at the moment I am simply just not good enough a php programmer to accomplish the task. So any help and pull-requests are welcome.
######KCFinder integration:
IMPORTANT! KCFinder use php $_SESSION, when you create $ckeditor = new CKEditor(); (second parameter can disable KCFinder) $_SESSION['KCFINDER'] = array('disabled' => false); is set and KCFinder start to works. Now user can upload files on server! After user logout() you must use session_destroy() to disable KCFinder