https://github.com/rkit/fileapi-widget-yii2
FileApi widget for Yii2
https://github.com/rkit/fileapi-widget-yii2
fileapi files upload yii2
Last synced: 5 months ago
JSON representation
FileApi widget for Yii2
- Host: GitHub
- URL: https://github.com/rkit/fileapi-widget-yii2
- Owner: rkit
- License: mit
- Created: 2015-10-01T11:03:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-03-10T03:33:33.000Z (over 9 years ago)
- Last Synced: 2025-09-10T12:33:34.968Z (9 months ago)
- Topics: fileapi, files, upload, yii2
- Language: PHP
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# FileApi widget for Yii2
Wrapper for [FileAPI](https://github.com/mailru/FileAPI)
## Installation
```
composer require rkit/fileapi-widget-yii2
```
## Usage
> See FileApi docs https://github.com/RubaXa/jquery.fileapi/
```php
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
]
]);
?>
```
## Theme for Bootstrap 3
See in [assets/css/style.css](assets/css/style.css)