Hi i installed Imperavi Redactor Widget for Yii 2 in my application. This is this widget: https://github.com/vova07/yii2-imperavi-widget. But i can see that when I upload any image this widget save this image in my application before i click save() button. The point is when i click on image upload and for example I click "back button" this image is still in my application. Whether the author had not thought about it or I can fix this somewhere in code? I want to save image on my aplication only, when i click button save with my action. Now user can spam image and click forward button and pictures are saved in app anyway. How I can fix that? All what i do to start this widget i paste code to my controller:
public function actions()
{
return [
'error' => [
'class' => 'yii\web\ErrorAction',
],
'image-upload' => [
'class' => 'vova07\imperavi\actions\UploadAction',
'url' => '/images/blog/', // Directory URL address, where files are stored.
'path' => '@webroot/images/blog/' // Or absolute path to directory where files are stored.
],
'images-get' => [
'class' => 'vova07\imperavi\actions\GetAction',
'url' => '/uploads/blog/', // Directory URL address, where files are stored.
'path' => '@webroot/images/blog/', // Or absolute path to directory where files are stored.
'type' => '0',
],
'files-get' => [
'class' => 'vova07\imperavi\actions\GetAction',
'url' => '/files/blog/', // Directory URL address, where files are stored.
'path' => '@webroot/files/blog/', // Or absolute path to directory where files are stored.
'type' => '1',//GetAction::TYPE_FILES,
],
'file-upload' => [
'class' => 'vova07\imperavi\actions\UploadAction',
'url' => '/files/blog/', // Directory URL address, where files are stored.
'path' => '@webroot/files/blog/' // Or absolute path to directory where files are stored.
],
];
}
And my view:
<?= $form->field($model, 'Description')->widget(Widget::classname(), [
'settings' => [
'lang' => 'pl',
'minHeight' => 300,
'pastePlainText' => true,
'buttonSource' => true,
'plugins' => [
'clips',
'fullscreen'
],
'imageUpload' => Url::to(['/blog/blog-post/image-upload']),
'imageManagerJson' => Url::to(['/blog/images-get']),
'fileManagerJson' => Url::to(['/blog/files-get']),
'fileUpload' => Url::to(['/blog/file-upload'])
]
]);?>