This extension allows to add UEditor in a view.
Usage
...how to use this extension...
...can use code blocks like the following...
- UEditor download
- UEditor extension download and copy UEditor.php under ext.ueditor
- add the following code to your view file
$this->widget('ext.ueditor.UEditor', array( 'id'=>'editor', 'model'=>$model, 'attribute'=>'content', 'UEDITOR_CONFIG'=>array( 'UEDITOR_HOME_URL'=>Yii::app()->baseUrl.'/ueditor/', 'initialContent'=>'欢迎', 'imageUrl'=>Yii::app()->baseUrl.'/ueditor/php/imageUp.php', 'imagePath'=>Yii::app()->baseUrl.'/ueditor/php/', 'emotionLocalization'=>true, 'pageBreakTag'=>'[page]', /* 'toolbars'=>array( array( 'fullscreen', 'source', '|', 'undo', 'redo', '|', ), ), 'labelMap'=>array( 'fullscreen'=>'全屏','source'=>'源代码','redo'=>'重做','undo'=>'撤销', ), */ ), ));
Below is an example of directory organization
WebRoot/ assets protected/ components/ controllers/ extensions/ ueditor/ UEditor.php models/ views/ ueditor/ //(copy ueditor code resources,please download UEditor first ) index.php index-test.php
/* 对于前台提交过来的数据需要将其HTML进行特殊处理 //获取数据转化HTML特殊字符 $content = htmlspecialchars(stripslashes($_POST['content'])); 2. 然后可以读入数据库中 在读取显示数据的时候需要对转义的HTML进行解码; 3. 使用htmlspecialchars_decode($content);显示即可 Ueditor的基本使用如此! */