fruktozets / yii2-activecollection
Yii2 Dropzone 上传器
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: 2024-09-29 05:34:27 UTC
README
这是创建和验证关联模型的集合的失败项目。它运行正确,但由于Yii框架架构不支持此类功能,代码非常难以编写。
示例
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,
],
])