Hi,
I would like to know anyone know how to use redactor image upload?Is there any example?
Page 1 of 1
Redactor Upload Image
#3
Posted 12 December 2012 - 01:36 PM
I just committed easy to use actions for Redactor widget.
Check out https://github.com/j...to/yii-redactor
Modify the actions to your own taste.
Check out https://github.com/j...to/yii-redactor
Modify the actions to your own taste.
#4
Posted 12 December 2012 - 04:27 PM
janisto, on 12 December 2012 - 01:36 PM, said:
I just committed easy to use actions for Redactor widget.
Check out https://github.com/j...to/yii-redactor
Modify the actions to your own taste.
Check out https://github.com/j...to/yii-redactor
Modify the actions to your own taste.
Looks good.
Thank you
Hey Ho !
Let's go !
Let's go !
#5
Posted 11 June 2013 - 08:11 AM
I'm trying to upload images using this actions from github (https://github.com/j.../master/actions)
And a uploads folder is created with the image in it, and in the textarea I'm getting this:
>>>{"filelink":"\/uploads\/file\/content\/d4d8f1c6db38315b1b7cff06e62228cb.png"}
Is this how it should work, or am i missing something ?
And a uploads folder is created with the image in it, and in the textarea I'm getting this:
>>>{"filelink":"\/uploads\/file\/content\/d4d8f1c6db38315b1b7cff06e62228cb.png"}
Is this how it should work, or am i missing something ?
#6
Posted 12 June 2013 - 07:37 AM
Are you using file or image upload action?
How did you configure the controller and view?
How did you configure the controller and view?
#7
Posted 09 November 2013 - 07:58 AM
Hi janisto
i am using this code in my view(_form)
and following code in my controller
but i got this error
-----------------------------------------------------
SyntaxError: JSON.parse: expected property name or '}'
return window.JSON.parse( data );
-------------------------------------------------------
please help me where i m wrong...sorry for my poor English
i am using this code in my view(_form)
$attribute='description'; Yii::import('ext.imperavi-redactor-widget.ImperaviRedactorWidget'); $this->widget('ImperaviRedactorWidget', array( // You can either use it for model attribute 'model' => $model, 'attribute' =>$attribute, // or just for input field 'name' => 'description', // Some options, see http://imperavi.com/redactor/docs/ 'options' => array( 'fileUpload' => Yii::app()->createUrl('post/fileUpload', array( 'attr' => $attribute, )), 'fileUploadErrorCallback' => new CJavaScriptExpression( 'function(obj,json) { alert(json.error); }' ), 'imageUpload' => Yii::app()->createUrl('post/imageUpload', array( 'attr' => $attribute, )), 'imageUploadErrorCallback' => new CJavaScriptExpression( 'function(obj,json) { alert(json.error); }' ), ), )); ?>
and following code in my controller
public function actions() { return array( 'fileUpload'=>array( 'class'=>'ext.imperavi-redactor-widget.ImperaviRedactorWidget.actions.FileUpload', 'uploadPath'=>Yii::getPathOfAlias('webroot').'/uploads', 'uploadUrl'=>Yii::getPathOfAlias('webroot').'/uploads', 'uploadCreate'=>true, 'permissions'=>0755, ), 'imageUpload'=>array( 'class'=>'ext.imperavi-redactor-widget.ImperaviRedactorWidget.actions.ImageUpload', 'uploadPath'=>Yii::getPathOfAlias('webroot').'/uploads', 'uploadUrl'=>Yii::getPathOfAlias('webroot').'/uploads', 'uploadCreate'=>true, 'permissions'=>0755, ), ); }
but i got this error
-----------------------------------------------------
SyntaxError: JSON.parse: expected property name or '}'
return window.JSON.parse( data );
-------------------------------------------------------
please help me where i m wrong...sorry for my poor English
#8
Posted 03 January 2014 - 07:08 AM
Hi Amjad,
I have faced the same issue and fixed.
Do you have a folder named "actions" in extensions/imperavi-redactor-widget ?
If not you can download it from the link provided by janisto above
That will fix your issue
I have faced the same issue and fixed.
Do you have a folder named "actions" in extensions/imperavi-redactor-widget ?
If not you can download it from the link provided by janisto above
That will fix your issue
Share this topic:
Page 1 of 1