fruktozets / yii2-activecollection
Yii2 Dropzone uploader
1.0.1
2018-09-20 10:45 UTC
Requires
- php: >=7.2.0
- fruktozets/yii2-dropzone: ^1.0
- yiisoft/yii2: 2.0.*
- yiisoft/yii2-jui: 2.0.*
Requires (Dev)
- yiisoft/yii2-debug: 2.0.*
This package is not auto-updated.
Last update: 2025-08-17 10:10:21 UTC
README
This is the unsuccessful project for creating and validate collections for a linked model. It's working correctly but the code is very difficult because of Yii framework architecture is not support a feature like this.
Example:
ActiveCollectionWidget::widget([
'model' => $customer, // Model for creating a template.
'data' => $customerModels, // Existing models for initialization.
'formId' => $form->id,
'fields' => [
[
'attribute' => 'image_id',
'template' => ActiveCollectionWidget::TEMPLATE_DROPZONE,
'widgetOptions' => [
"addRemoveLinks" => "true",
"acceptedFiles" => "image/*",
"dictDefaultMessage" => "Drop file here or click to upload",
"url" => "/image/upload",
"maxFiles" => 1,
],
'fio' => ActiveCollectionWidget::TEMPLATE_TEXT,
'zipcode' => ActiveCollectionWidget::TEMPLATE_NUMBER,
'position' => ActiveCollectionWidget::TEMPLATE_TEXTAREA,
],
])