cleditor

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

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

Requirements

Yii 1.1 or above.

Usage

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

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

Simple usage
 
    $this->widget('application.extensions.cleditor.ECLEditor', array(
        'name'=>'field',
    ));
 
With models
 
    $this->widget('application.extensions.cleditor.ECLEditor', array(
        'model'=>$model,
        'attribute'=>'fieldName', //Model attribute name. Nome do atributo do modelo.
        'options'=>array(
            'width'=>'600',
            'height'=>250,
            'useCSS'=>true,
        ),
        '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á.
    ));

Resources

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

pt-BR
* 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 16 comments

#8056 report it
powers 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
jzhong5 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
Include Iframe or Object

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

I have a question, it possible to use youtube videos, or other videos with this extension?

While on testing i can see the videos being shown when i'm pasting the iframe/object code but when i save and preview this i can't see the code, any ideas what to change to display iframe or objects on my views?

#5430 report it
ivanwhm at 2011/10/11 01:13pm
Great

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
ivanwhm at 2011/09/10 09:56am
Fantástica

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 :)

thanks!

#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!

#3088 report it
trejder at 2011/03/15 09:58am
Problems in IE

I've noticed some bugs using this extension in Internet Explorer. HTML tags added for formatting are upper-case (which make them not compatibile with XHTML) and in some situations a strange behaviour appears. For example - paragraphs (p) are inserted instead of line breaks (br) which makes the very same text entered to the same editor under IE and FF look differently on page, because, when entered using IE it is encoded differently than when entering under FF.

I'm pretty sure that this is caused by JavaScript code, not by Yii Extension itself. But just wanted to ask if others has the same experience using this extension / editor under Internet Explorer?

#2970 report it
trejder at 2011/03/03 07:35pm
Shortcut

Hi again,

Is there any way to add shortcuts catching to this editor, so for example Ctrl+B would turn on bold mode, Ctrl+I - italics, and so on, just as it is done in forum editor, when switched to rich-editor in configuration.

#2969 report it
thiagovidal at 2011/03/03 05:50pm
Hey

Thanks guy. I always think of simple usage.

#2968 report it
trejder at 2011/03/03 05:37pm
Perfect!

A complete perfection! Nothing to add, nothing to remove! Just about fifteen seconds of coding and there you go... fully operational, yet lightweigth WYSIWYG editor. Great! Thanks!

#2623 report it
huanito at 2011/01/24 12:24am
awesome

very simple to use. Easy to configure. Thanks! A bonus for me was the height attribute working for small values. You can do an editor for a single line if you choose.

#2200 report it
saebaryo at 2010/11/24 09:26am
easy

very simple and easy to use, just change the fieldName

Leave a comment

Please to leave your comment.

Create extension