To start with you need to download the latest stable release of CKeditor. Extract the downloaded file and place the ckeditor/ folder in your applications webroot directory. (beside "protected" and "css" and other directories)
WARNING: if you put the ckeditor in 'protected' directory it will NOT work.
Next to do is to download the The CKeditor Integration extension, created by Ali Qanavatian. Extract the downloaded file, and place the ckeditor/ widget folder in your web applications protected/extensions/ directory.
In the view where you want to use the CKeditorWidget:
$this->widget('application.extensions.ckeditor.cKEditorWidget',array( 'model'=>$pages, # Data-Model (form model) 'attribute'=>'content', # Attribute in the Data-Model 'height'=>'400px', 'width'=>'100%', 'toolbarSet'=>'Basic', # EXISTING(!) Toolbar (see: ckeditor.js) 'ckeditor'=>Yii::app()->basePath.'/../ckeditor/ckeditor.php', # Path to ckeditor.php 'ckBasePath'=>Yii::app()->baseUrl.'/ckeditor/', # Relative Path to the Editor (from Web-Root) 'css' => Yii::app()->baseUrl.'/css/index.css', # Additional Parameters ) );
If those instructions have been followed exactly the CKeditor should work correctly.
NOTE: linux users keep an eye on permissions of files and directories.
Total 3 comments
These instructions didn't work for me, so I figured out how to get this all set up, and posted a new set of instructions that work as of 12/12/12 here: Instructions that work
please use the forum link to ask questions, and put your code sample so that people can help better.
Hi,
I'm getting error on view:
Leave a comment
Please login to leave your comment.