Yii 1.1: wysiwyg-text-editor

xheditor widget
11 followers

This widgets will be updated as soon as xheditor releases their 1.0.0 version (http://code.google.com/p/xheditor/)

It will make use of the latest version of jquery.

This extension is a wysiwyg text editor that can be applied to your forms.

Resources

Documentation

Requirements

  • Yii 1.0 or above

Installation

  • Extract the release file under protected/components/widgets

Usage

See the following code example:

<?php
            $this->widget('application.components.widgets.XHeditor',array(
                'language'=>'en', //options are en, zh-cn, zh-tw
                'config'=>array(
                    'id'=>'xh1',
                    'name'=>'xh',
                    'tools'=>'mini', // mini, simple, fill or from XHeditor::$_tools
                    'width'=>'100%',
                    //see XHeditor::$_configurableAttributes for more
                ),
                'contentValue'=>'Enter your text here', // default value displayed in textarea/wysiwyg editor field
                'htmlOptions'=>array('rows'=>5, 'cols'=>10),// to be applied to textarea
            ));
            ?>
 
            //with a model
            <?php
            $this->widget('application.components.widgets.XHeditor',array(
                'model'=>$modelInstance,
                'modelAttribute'=>'attribute',
                'showModelAttributeValue'=>false, // defaults to true, displays the value of $modelInstance->attribute in the textarea
                'config'=>array(
                    'id'=>'xh1',
                    'name'=>'xh',
                    'tools'=>'mini', // mini, simple, fill or from XHeditor::$_tools
                    'width'=>'100%',
                    //see XHeditor::$_configurableAttributes for more
                ),
            ));
            ?>

Change Log

January 7, 2010

  • Initial release.

Code requires documentation. Will be done by the weekend.

Total 20 comments

#12573 report it
GusDeCooL at 2013/03/29 09:14am
Chinese Documentation

Not Recommended, The official documentation use chinnese language

#10610 report it
Giacomo at 2012/11/07 06:47pm
upload functionality

Hey guys, what about the upload functionality? Does anyone solved the issue?

Thanks

#4672 report it
foobarbaz at 2011/08/02 11:55am
Popup removing

Make sure that you also delete assets folder to force yii use the new updated .js file.

#3978 report it
quarkmarino at 2011/05/24 03:25pm
Popup removed

Thank you, that was helpful, great extension.

#3977 report it
PeRoChAk at 2011/05/24 02:15pm
popup removing on submiting the form

In the language file of js i.e. xheditor-en.js for english comment the line # 197 starting with

jpWin.unload
#3782 report it
quarkmarino at 2011/05/07 09:10pm
anoying popup

Hey, I have the same problem with the popup, it is very anoying, and I can't found where to disable it, it's a great extension, but it needs more infomation about config and functionality.

#2889 report it
elMura at 2011/02/22 04:28pm
Problem with confirmation popup

This is a good extension but have a problem. When submit form open confirm popup javascript. Any idea?

Regards.

#2720 report it
xbliz at 2011/01/31 12:14pm
great

I'm goint yo wait for the release i hope its going to solve the upload problem :D

#2719 report it
jayrulez at 2011/01/31 12:06pm
Good news

The updated version of the widget is finished. I'm have left to do: proper documentation, further testing and writing examples before releasing it. If all goes well, then it will be posted this week.

#2670 report it
jayrulez at 2011/01/26 10:36am
update

Sorry about the long wait (been busy with school, work & projects). I will provide an update of the xheditor version by sunday the 30th of this month with a better api and docs.

#2666 report it
xbliz at 2011/01/26 09:34am
upload

hi guyz i'm kinda new at yii, before i was using ckeditor and I really liked it, however i'm workin on a new project and i want to try yii and xheditor. I have tried the demo, and i figured out that xheditor has a built in uploader.

I have the upload.php file on "extensions/xheditor/upload.php"

        $this->widget('application.extensions.XHeditor',array(
            'language'=>'en', //options are en, zh-cn, zh-tw
            'config'=>array(
                'id'=>'xh1',
                'name'=>'xh',
                'tools'=>'full', // mini, simple, fill or from XHeditor::$_tools
                'width'=>'100%',
                'upLinkUrl'=>'{editorRoot}upload.php',
                'upLinkExt'=>"zip,rar,txt",
                'upImgUrl'=>'{editorRoot}upload.php',
                'upImgExt'=>"jpg,jpeg,gif,png"
            ),
            'contentValue'=>'Enter your text here', 
            'htmlOptions'=>array('rows'=>5, 'cols'=>10)
        ));

this shows me the editor, but on then image button it does not display the upload option any suggestions? NOte: im using the latest version of xheditor1.1.3

#2457 report it
yes.yii at 2011/01/05 10:47am
you should update the Heditor now!

you should update the Heditor now! the latest official version is up to xheditor-1.1.3.zip :) fix some bug !

#461 report it
persia at 2010/05/25 09:04am
upload a file

Hi,

I want to upload a file using the xheditor, so i added this in the view:

'upImgUrl' => 'create' // the action name in the controller

In my controller i have this:

$model=new Item; if(isset($_POST['Item'])) { $model->attributes=$_POST['Item']; $model->image=CUploadedFile::getInstance($model,'image'); if($model->save()) { $model->image->saveAs('./myfiles'); } } $this->render('create', array('model'=>$model));

but i have this following error: create upload interface error

Do you have an idea how can i solve this ?

Thanks

#622 report it
jayrulez at 2010/04/07 02:35am
Update

I will update the widget to the new version of xheditor which is compatible with jquery 1.4 within the coming week.

#680 report it
gazbond at 2010/03/20 05:39am
Nice extension

Have been using this extension for a while and love it. With Yii 1.1.1 and therefore jQuery 1.4 there is a problem. When you navigate away from a page with this widget it displays a confirm dialog - are you sure you want to navigate away from this page. Strange!

#824 report it
pangjanne at 2010/02/23 08:38pm
solved

this issues are solved.(my problem, no code issues)

#827 report it
pangjanne at 2010/02/23 02:27am
chrome issues

test in chrom, there are some problem. all button fall flat, no effect on selected text.

#931 report it
mauphung at 2010/01/26 10:51am
How to save

Very good widget. Please give some hints how to save content after editing. Thanks

#962 report it
Alex Muir at 2010/01/19 06:09am
This could be the DEFINITIVE editor

Excellent - painless, lightweight. I used to use TinyMce but this might well take over from that.

#1022 report it
jayrulez at 2010/01/07 03:20pm
Documentation

[php] <?php $this->widget('application.components.widgets.XHeditor',array( 'language'=>'en', //options are en, zh-cn, zh-tw 'config'=>array( 'id'=>'xh1', 'name'=>'xh', 'tools'=>'mini', // mini, simple, full or from XHeditor::$_tools 'width'=>'100%', //see XHeditor::$_configurableAttributes for more ), 'contentValue'=>'Enter your text here', // default value displayed in textarea/wysiwyg editor field 'htmlOptions'=>array('rows'=>5, 'cols'=>10),// to be applied to textarea )); ?>

        //with a model
        <?php
        $this->widget('application.components.widgets.XHeditor',array(
            'model'=>$modelInstance,
            'modelAttribute'=>'attribute',
            'showModelAttributeValue'=>false, // defaults to true, displays the value of $modelInstance->attribute in the textarea
            'config'=>array(
                'tools'=>'full', // mini, simple, fill or from XHeditor::$_tools
                'width'=>'300',
            ),
        ));
        ?>

[/php]

Leave a comment

Please to leave your comment.

Create extension