mztest/yii2-widget-file-upload

A widget for uploading files to your server.

1.0.0 2017-03-01 09:44 UTC

This package is not auto-updated.

Last update: 2024-04-28 00:15:56 UTC


README

Easily upload any files to your server in Yii Framework 2.0. The extension uses the jQueryFileUpload.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist mztest/yii2-widget-file-upload "*"

or add

"mztest/yii2-widget-file-upload": "*"

to the require section of your composer.json file.

Usage

  1. Set upload action at your controller

    public function actions()
    {
        return [
            'upload' => [
                'class' => 'mztest\upload\actions\FileUploadAction',
            ],
        ];
    }
  2. simply use it in your code by :

    use mztest\upload\FileUpload;
    <?= $form->field($model, 'floor_image')->widget(FileUpload::className(), [
        'uploadAction' => ['upload']
    ]) ?>