Image Ajax
This is the Image Ajax widget Yii 2 enhanced wrapper for the Dropzone library. A simple way to do ajax loading image on the site.
Installation
The preferred way to install this extension is through composer.
Either add
"require": {
"keygenqt/yii2-image-ajax": "*"
}
of your composer.json
file.
Usage
<?= $form->field($model, 'image')->widget(ImageAjax::class, [
'label' => false,
'btnSelect' => 'Choose',
'btnDelete' => 'Delete',
'url' => ['ajax/upload-image', 'type' => 'test'],
'subtitle' => 'This video will change its size to 360х360, so keep that in mind.',
'afterUpdate' => 'function() {
console.log("call afterUpdate")
}'
]) ?>