toxor88 / yii2-widget-fineuploader
Enhanced Yii2 wrapper for the Fineuploader.js plugin.
Installs: 358
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/fine-uploader: 5.11.8
- yiisoft/yii2: >=2.0.6
This package is auto-updated.
Last update: 2024-12-24 18:38:59 UTC
README
See https://github.com/FineUploader/fine-uploader.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist toxor88/yii2-widget-fineuploader "*"
or add
"toxor88/yii2-widget-fineuploader": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your code by :
<?= \toxor88\fineuploader\Fineuploader::widget([ // by default it uses the jQuery wrapper for the library, if you want the native one, use this: 'jQuery' => false, 'clientOptions' => [ 'request' => [ 'endpoint' => Yii::$app->urlManager->createUrl(['/your-handler']), 'params' => [Yii::$app->request->csrfParam => Yii::$app->request->csrfToken] ], 'validation' => [ 'allowedExtensions' => ['jpeg', 'jpg', 'png', 'bmp', 'gif'], ], 'classes' => [ 'success' => 'alert alert-success hidden', 'fail' => 'alert alert-error' ], ], 'clientEvents' => [ 'autoRetry' => '', 'cancel' => '', 'complete' => '', ... ] ]) ?>