harrytang/yii2-fineuploader

This package is abandoned and no longer maintained. No replacement package was suggested.

Fine Uploader extension for Yii2

Installs: 1 653

Dependents: 0

Suggesters: 0

Security: 0

Stars: 7

Watchers: 5

Forks: 6

Type:yii2-extension

1.0.0 2017-12-03 07:40 UTC

This package is not auto-updated.

Last update: 2022-02-01 12:41:42 UTC


README

Fine Uploader extension for Yii2

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist powerkernel/yii2-fineuploader "*"

or add

"powerkernel/yii2-fineuploader": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

View

<?= powerkernel\fineuploader\Fineuploader::widget([
    'options' => [
        'request' => [
            'endpoint' => Yii::$app->urlManager->createUrl(['/your-handler-url']),
            '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'
        ],
        // other options like
        //'multiple'=>false,
        //'autoUpload'=>false
    ],
    //'events' => [
    //    'allComplete' => '$("#loading").modal("hide"); ',
    //]
])
?>

Controller see https://github.com/FineUploader/php-traditional-server