rkit/fileapi-widget-yii2 FileApi widget for Yii2

extensionwidgetuploadfilesfileapi

FileApi widget for Yii2

Wrapper for FileAPI

Installation

composer require rkit/fileapi-widget-yii2

Usage

See FileApi docs 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
        ]
    ]);
?>

Theme for Bootstrap 3

See in https://github.com/rkit/fileapi-widget-yii2/blob/master/assets/css/style.css

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.4 is the latest of 4 releases



MIT license
Stats
0 github stars & 0 github forks
0 downloads in the last day
2 downloads in the last 30 days
986 total downloads