Answer the question
In order to leave comments, you need to log in
How to delete and save images kartik\file\FileInput in Yii2?
I use kartik\file\FileInput https://plugins.krajee.com/file-plugin-methods-demo
<?= $form->field($model, 'imageFile')->widget(FileInput::classname(), [
'options' => ['accept' => 'image/*'],
'pluginOptions' => [
'initialPreview'=> [
(new common\models\Pricelist)->logoLink ? (new common\models\Pricelist)->logoLink : NULL,
],
'showPreview' => true,
'showCaption' => false,
'showRemove' => false,
'showUpload' => false,
'showBrowse' => false,
'browseOnZoneClick' => true,
'initialPreviewAsData'=>true,
'allowedFileExtensions'=>['jpg','jpeg','gif','png'],
]
]); ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question