mzaman / laravel-ckeditor

A Laravel 3.x bundle for integrating CKEditor in your applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel-CKEditor-Bundle

A Laravel 3.x bundle for integrating CKEditor in your applications.

CKEditor Bundle, by Vilhjalmur Magnusson

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

######5. Add the following to your view file to include the CKEditor Javascript:

Asset::container('ckeditor')->scripts();

######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.

About

A Laravel 3.x bundle for integrating CKEditor in your applications.