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.
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
Update
I will update the widget to the new version of xheditor which is compatible with jquery 1.4 within the coming week.
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!
solved
this issues are solved.(my problem, no code issues)
chrome issues
test in chrom, there are some problem. all button fall flat, no effect on selected text.
How to save
Very good widget. Please give some hints how to save content after editing.
Thanks
This could be the DEFINITIVE editor
Excellent - painless, lightweight. I used to use TinyMce but this might well take over from that.
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]
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 !
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
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.
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.
great
I'm goint yo wait for the release i hope its going to solve the upload problem
:D
Problem with confirmation popup
This is a good extension but have a problem. When submit form open confirm popup javascript.
Any idea?
Regards.
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.
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
Popup removed
Thank you, that was helpful, great extension.
Popup removing
Make sure that you also delete assets folder to force yii use the new updated .js file.
upload functionality
Hey guys, what about the upload functionality? Does anyone solved the issue?
Thanks
Chinese Documentation
Not Recommended, The official documentation use chinnese language
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.