2017 © Pedro Peláez
 

yii2-extension uploader

Yii2 file uploader

image

laco-agency/uploader

Yii2 file uploader

  • Friday, May 11, 2018
  • by laco-agency
  • Repository
  • 2 Watchers
  • 0 Stars
  • 51 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

uploader

yii2 file uploader, (*1)

Installation

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

Either run, (*3)

composer require --prefer-dist laco-agency/uploader

or add, (*4)

"laco-agency/uploader":"*"

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

Usage

Add module to config file, (*6)


'uploader' => ['class' => '\laco\uploader\Module'],

Attach UploadBehavior to model and configere file attributes, (*7)


use laco\uploader\processor\ImageProcessor; use laco\uploader\storage\ModelStorage; use laco\uploader\storageFile\StorageFile; use laco\uploader\behaviors\UploadBehavior; class Model extends yii\db\ActiveRecord { public function behaviors() { return [ [ 'class' => UploadBehavior::className(), 'uploadAttributes' => [ 'image_preview' => [ 'class' => StorageFile::className(), 'storage' => ModelStorage::className(), 'processOptions' => [ 'origin' => [ 'class' => ImageProcessor::className(), 'width' => 912, 'height' => 570, 'crop' => true ], 'thumb' => [ 'class' => ImageProcessor::className(), 'width' => 244, 'height' => 138, 'crop' => true ], ] ], ] ] ]; } // Configure validation rules for files attributes as regular public function rules() { return [ [['image_preview'], 'image'], ]; } }

Image file input

In view file, (*8)

use \laco\uploader\widgets\image\Image;

    <?= $form->field($model, 'image_preview')->widget(Image::className(),
    ['imageUrl' => $model->getFileUrl('image_preview', 'thumb')]); ?>

TinyMCE

In view file, (*9)

use laco\uploader\widgets\tinymce\TinyMce;

= $form->field($model, 'content')->widget(TinyMce::className()); ?>

The Versions

11/05 2018

dev-master

9999999-dev http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

11/05 2018

v0.3.6

0.3.6.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

14/01 2018

v0.3.5

0.3.5.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

14/01 2018

v0.3.4

0.3.4.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

02/11 2017

v0.3.3

0.3.3.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

13/09 2017

v0.3.2

0.3.2.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

07/09 2017

v0.3.1

0.3.1.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

05/09 2017

v0.3.0

0.3.0.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

23/08 2017

v0.2.2

0.2.2.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

14/08 2017

v0.2.1

0.2.1.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader

14/08 2017
12/06 2017

v0.1

0.1.0.0 http://github.com/laco-agency/uploader

Yii2 file uploader

  Sources   Download

MIT

The Requires

 

file yii2 upload uploader