2017 © Pedro PelĂĄez
 

yii2-extension yii2-dropzone

DropzoneJs Extention for Yii2 based on Parminder repo

image

vinpel/yii2-dropzone

DropzoneJs Extention for Yii2 based on Parminder repo

  • Friday, November 10, 2017
  • by vinpel
  • Repository
  • 1 Watchers
  • 0 Stars
  • 94 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 24 Forks
  • 0 Open issues
  • 7 Versions
  • 15 % Grown

The README.md

Yii2 Dropzone

DropzoneJs Extention for Yii2, (*1)

A port of DropzoneJs for Yii2 Framework, (*2)

based from work of Parminder Klair : https://github.com/perminder-klair/yii2-dropzone, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require --prefer-dist vinpel/yii2-dropzone "~1.0.4"

or add, (*6)

"vinpel/yii2-dropzone": "~1.0.4"

to the require section of your composer.json file., (*7)

Usage

Once the extension is installed, simply use it in your code by to create Ajax upload area :, (*8)

echo \vinpel\DropZone::widget();

To pass options and client event : (More details at dropzonejs official docs ), (*9)

echo \vinpel\DropZone::widget([
       'options' => [
           'maxFilesize' => '2',
       ],
       'clientEvents' => [
           'complete'    => "function(file){console.log(file)}",
           'removedfile' => "function(file){alert(file.name + ' is removed')}"
       ],
   ]);

Example of upload method :, (*10)

public function actionUpload()
{
    $fileName = 'file';
    $uploadPath = './files';

    if (isset($_FILES[$fileName])) {
        $file = \yii\web\UploadedFile::getInstanceByName($fileName);

        //Print file data
        //print_r($file);

        if ($file->saveAs($uploadPath . '/' . $file->name)) {
            //Now save file data to database

            echo \yii\helpers\Json::encode($file);
        }
    }

    return false;
}

The Versions

10/11 2017

dev-master

9999999-dev

DropzoneJs Extention for Yii2 based on Parminder repo

  Sources   Download

MIT

The Requires

 

extension yii2 upload dropzone

10/11 2017

v1.0.5

1.0.5.0

DropzoneJs Extention for Yii2 based on Parminder repo

  Sources   Download

MIT

The Requires

 

extension yii2 upload dropzone

10/11 2017

v1.0.4

1.0.4.0

DropzoneJs Extention for Yii2 based on Parminder repo

  Sources   Download

MIT

The Requires

 

extension yii2 upload dropzone

10/11 2017

v1.0.3

1.0.3.0

DropzoneJs Extention for Yii2 based on Parminder repo

  Sources   Download

MIT

The Requires

 

extension yii2 upload dropzone

10/11 2017

v1.0.2

1.0.2.0

DropzoneJs Extention for Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 upload dropzone

09/11 2015

v1.0.1

1.0.1.0

DropzoneJs Extention for Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 upload dropzone

23/10 2014

v1.0.0

1.0.0.0

DropzoneJs Extention for Yii2

  Sources   Download

MIT

extension yii2 upload dropzone