Integrating CK Editor with CakePHP
CkEditor is the new WYSIWYG editor from the maker of FckEditor – which has been one of the best editors around for a while now.
To use CkEditor instead of a boring old textarea input in your cakephp views all you have to do is follow these very simple instructions.
1. Download the editor from http://ckeditor.com/download
2. Unzip it and put the ckeditor directory into your webroot.
3. Include the javascript helper in your controller
Show Plain Text4. tell your view to include the ckeditor/ckeditor.js file
Show Plain Text5. Make sure your layout is looking for the javascript files variable like this:
Show Plain Text- echo $content_for_layout;
6. replace your textareas with CkEditors by class name by adding the classname ‘ckeditor’ to your input.
Show Plain TextHopefully thats got you a nice wysiwyg with all the buttons etc. Ckeditor is easy to configure to give your users as much or as little creative freedom as you need. Enjoy!
If you think there is a better way, or have a sugestion, post a comment and let me know.
