rkit / fileapi-widget-yii2
Yii2的FileApi小部件
1.0.4
2015-12-07 15:34 UTC
Requires
- rubaxa/fileapi: ^0.4.11
- yiisoft/yii2: ^2.0
This package is not auto-updated.
Last update: 2024-09-14 18:26:00 UTC
README
包装FileAPI
安装
composer require rkit/fileapi-widget-yii2
使用
查看FileApi文档https://github.com/RubaXa/jquery.fileapi/
use rkit\fileapi\Widget as FileApi; … <?= $form->field($model, $attribute, ['template' => "{label}\n{error}\n{input}\n{hint}"]) ->widget(FileApi::className(), [ 'template' => '@app/path/to/template', 'callbacks' => [ 'select' => new JsExpression('function (evt, ui) {}'), 'filecomplete' => [new JsExpression('function (evt, ui) {}'), ]], 'settings' => [ 'url' => yii\helpers\Url::toRoute('/url/to/upload'), 'imageSize' => ['minWidth' => 1000], 'accept' => 'image/*', 'duplicate' => true ] ]); ?>