Another CKEditor extension that uses the parameters based on CKEditor API.
-- Changes in version 0.1 --
protected/extensionsSee the following code example:
$this->widget( 'application.extensions.NHCKEditor.CKEditorWidget', array( // [Required] CModel object 'model' => $model, 'attribute' => 'ATTRIBUTE_NAME', // [Optional] CSS file to be included 'cssFile' => Yii::app()->request->baseURL.'/css/YOUR_FILE.css', // [Optional] Options based on CKEditor API documentation 'editorOptions' => array( // Now supports PHP array and javascript code (must begin with js:) //'width' => 800, //'height' => 480, //'language' => 'th', //'toolbar' => 'Full', // format #1: String //'toolbar' => array( // format #2: PHP array // array('Source', '-', 'Save') //), //'toolbar' => "js:[ // format #3: javascript code // ['Source', '-', 'Save'] //]", //'uiColor' => '', // ... your own options ), // [Optional] htmlOptions based on Yii implementation 'htmlOptions' => array( // ), ) );
Total 8 comments
Hi
who enable or disable editor?
i pass html_options array('readonly'=>'readonly') but not work
Hello, thanks for this very good and useful extension. I use it to combine CKEditor and CKFinder, I only pass path to CKFinder script bellow "// ... your own options" line.
However, is there any option to configure where images and other will be uploaded by CKFinder? In CKFinder main configuration, there is one properity $baseUrl where you can do that. Default is '/ckfinder/userfiles/'.
However, that confiuration script does not understand Yii coined urls like Yii::app()->baseUrl; and similar. Also, I don't like to mess up with this config script, especially if I'll use it for several webpages.
So, is there any possibility to set this from widget? Does anyone have experience with this?
In order for this widget to work with 1.1.3, the visibility of the protected properties ($editorOptions, etc) of CKEditorWidget must be changed from protected to public.
it does not works with 1.1.3 properity editorOptions is not defined.
CKEditor also works in combination with Ajax, e.g. a CActiveForm. For more information:
Forum topic on CKEditor with CActiveForm
@gazbond thanks for your help. I'll fix this in the next version.
You cannot configure like:
Or like: The first produces the following javascript: And the second: I think you should add the following to CKEditorWidget->jsOptions(): You can then use php arrays.Leave a comment
Please login to leave your comment.