Yii 1.1: cleditor

CLEditor is an os jQuery plugin which provides a lightweight, cross browser, extensible, WYSIWYG editor.


I won't be able to update this extension for a while. If any contributor want to help me, please send me a inbox message on forum. Thanks.

I already found this extension here but I made one more simple.


Yii 1.1 or above.


Unpack the contents under the desired folder. For beginners probably it will be '/protected/extensions'.

Descompacte o conteúdo do arquivo na pasta desejada. Para iniciantes provavelmente será 'protected/extensions'.

Simple usage
    $this->widget('application.extensions.cleditor.ECLEditor', array(
With models
    $this->widget('application.extensions.cleditor.ECLEditor', array(
        'attribute'=>'fieldName', //Model attribute name. Nome do atributo do modelo.
        'value'=>$model->fieldName, //If you want pass a value for the widget. I think you will. Se você precisar passar um valor para o gadget. Eu acho irá.


* CLEditor resource page. Plese follow to see available options.
* Try out a demo, from author plugin.
* Discussion & Bug report.

* CLEditor. Siga este link para ver as opções disponives.
* Demonstração, página do plugin do autor com exemplo.
* Discussão e Relato de Erros.

Total 20 comments

#19760 report it
mostofa62 at 2016/01/25 05:28am
Nice Extension

If you any one face ,this not working with latest jquery download update

CLEditor js,css file from there website.

#15233 report it
nirmalroka at 2013/10/20 06:03am
How to use onkeyUp event on cle editor

Hi I want to use onkey up event in cleditor, but i can't figure out how to do this. I actually want to implement hastag features using cleditor and changing color of the text while key is when editor got text with hastag.

If there any good method to implement hastag than please let me know.

But i want to do this with cleditor.

#12534 report it
Lal Zada at 2013/03/27 03:02am
not support multiple editors at the same page

Each time one is normal and other editors changes back to text area.

#12090 report it
Vicer at 2013/02/26 11:51pm
RE: Out put HTML


...How can I change the output so I can directly see my input?(instead the code above)

I was looking around for this and found that you can use: 'output_attribute:html' // to display 'output_attribute' field in html

..if you are using CDetailed view for outputting

#9993 report it
jiaming at 2012/09/27 12:44pm
thanks for the help but i think the problem is the following:

thanks for the help but i think the problem is the following:

Have you guys tried to render multiple textareas point to the SAME attributes in the SAME model? (even different model->id)

Your example shows 2 CLEditor for 2 attributes. Try for one, then you will find that the second one is not working....

Again,thanks so much for your help! I already post this problem in the forum of the link you gave to me.

#9992 report it
thiagovidal at 2012/09/27 11:31am
re:re: Multiple editors same page? jiaming

Hey go to forum insted and place your view code there so I can try help you out.


#9990 report it
jiaming at 2012/09/27 10:11am
re:re: Multiple editors same page?

@huanito, Thanks for your help. But unfortunately, my case is different and your code is not working for me.

I am using kinda like a "fast reply system". Like yii's blog demo. But i have the same form.php rendered multiple times in the same page. (to fast reply different posts).

In this case, if i simply change my form.php 's textarea into Cleditor, only the first "fast reply textarea" is cleditor, others still are textareas...

I believe it's because of javascript conflicts, but i tried to only register them once in the layout, still not work.

#9985 report it
huanito at 2012/09/27 01:58am
re: Multiple editors same page?

@jiaming works for me, two cleditors on same page, here is my view relevant parts

<div class="row">
                <?php echo $form->labelEx($model,'title'); ?>
                $this->widget('ext.cleditor.ECLEditor', array(
                'attribute'=>'title', //Model attribute name. Nome do atributo do modelo.
                'controls'=>'italic underline color highlight removeformat source',
                <?php echo $form->error($model,'title'); ?>
       <div class="row">
                <?php echo $form->labelEx($model,'body'); ?>
                <?php $this->widget('ext.cleditor.ECLEditor', array(
                <?php echo $form->error($model,'body'); ?>
#9984 report it
jiaming at 2012/09/26 11:45pm
Multiple editors same page?

Looks like it not support multiple editors at the same page. Each time i did this, one is normal and other editors changes back to text area.

Any solutions? Thanks

#9729 report it
nirmalroka at 2012/09/07 04:17am
I want to customize this.

Hi this extension is great and work fine for most of things but I want to add some parameter as something like

<span class="myclass"></span>

in the section where the is drop down list of

[["Paragraph", "<p>"], ["Header 1", "<h1>"], ["Header 2", "<h2>"],
                    ["Header 3", "<h3>"],  ["Header 4","<h4>"],  ["Header 5","<h5>"],
                    ["Header 6","<h6>"]],

So that my content get my layout with out any difficulties.

If any one done before than please help me out.

Thank you.

#8056 report it
ItsYii at 2012/05/07 11:18am
HTML tags problem

If you're like me and got a problem that displays the HTML tags when using this editor make sure you don't use the CHTML::encode designed for yii. instead just use

<?php echo $model->MODEL_NAME; ?>

Not sure what it is (security?) but the CHTML::encode with CKEDITOR displays tags as text.

#7779 report it
jiaming at 2012/04/17 11:05pm
Out put HTML

Excellent extension... But i do have a question about the output.

I always get things like this (SPAN)..........(/SPAN) (sorry i can't put html here)

So it HTML.

How can I change the output so I can directly see my input?(instead the code above)

#7754 report it
DigiFox at 2012/04/15 06:21am
Unbelievably simple

Took me longer to think about what I wanted than to implement this thing. Thanks for this extension and the excellent code snippet.

#7256 report it
WebDevPT at 2012/03/07 11:22am
Easy to use!

Congratulations, this works and it's very easy to use.

#5430 report it
Ivan Wilhelm at 2011/10/11 01:13pm

This is a great extension for Yii and i use in all my projects.

#5321 report it
Tohotom at 2011/10/04 06:49am
Input validation

Don't forget to add something like

array('fieldName','filter','filter'=>array($obj=new CHtmlPurifier(),'purify')),

to your model validation rules. This will keep all legal formatting, but remove any malicious code.

More details.

#5053 report it
Ivan Wilhelm at 2011/09/10 09:56am

Extensão fantástica. Parabéns pelo trabalho.

#4759 report it
alrissala at 2011/08/11 11:32pm
simple and powerfull

Thank you. I liked it very much :)

#3776 report it
barbq at 2011/05/07 12:37pm
very nice

piece of code :)


#3223 report it
nickcv at 2011/03/26 09:40am
just what i needed!

thanks a lot, i'm going to use this thing a lot!

Leave a comment

Please to leave your comment.

Create extension