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.
protected/components/widgetsSee the following code example:
$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 ), ));
Code requires documentation. Will be done by the weekend.
Total 20 comments
Not Recommended, The official documentation use chinnese language
Hey guys, what about the upload functionality? Does anyone solved the issue?
Thanks
Make sure that you also delete assets folder to force yii use the new updated .js file.
Thank you, that was helpful, great extension.
In the language file of js i.e. xheditor-en.js for english comment the line # 197 starting with
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.
This is a good extension but have a problem. When submit form open confirm popup javascript. Any idea?
Regards.
I'm goint yo wait for the release i hope its going to solve the upload problem :D
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.
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.
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
you should update the Heditor now! the latest official version is up to xheditor-1.1.3.zip :) fix some bug !
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
I will update the widget to the new version of xheditor which is compatible with jquery 1.4 within the coming week.
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!
this issues are solved.(my problem, no code issues)
test in chrom, there are some problem. all button fall flat, no effect on selected text.
Very good widget. Please give some hints how to save content after editing. Thanks
Excellent - painless, lightweight. I used to use TinyMce but this might well take over from that.
[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 login to leave your comment.