Yii 2.0: yii2-fineuploader

fineuploader for Yii2
2 followers

Yii2 Fine Uploader

Fine Uploader extension for Yii2

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

"modernkernel/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

<?= modernkernel\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

Total 2 comments

#20077 report it
Cozumel at 2017/05/01 08:23pm
Needs Work

Not a bad effort, but you hardwired the template and if you set 'auto-upload' to false there's no upload button.

#20014 report it
paskuale at 2017/01/16 04:53am
multiple instances ?

How can manage multiple instances of it in same form ?

Leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet