2017 © Pedro Peláez
 

yii2-extension uploader

uploader behavior based on mohorev/yii2-upload-behavior

image

wardany/uploader

uploader behavior based on mohorev/yii2-upload-behavior

  • Monday, October 17, 2016
  • by muhammad wardany
  • Repository
  • 1 Watchers
  • 0 Stars
  • 36 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

uploader behavior

uploader behavior based on mohorev/yii2-upload-behavior, (*1)

Installation

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

Either run, (*3)

php composer.phar require --prefer-dist wardany/uploader "*"

or add, (*4)

"wardany/uploader": "*"

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

Usage

Once the extension is installed, simply use it in your code by :, (*6)

php function behaviors() { $baseurl = isset(Yii::$app->components['frontend']) ? Yii::$app->urlManagerFrontEnd->baseUrl : Yii::$app->urlManager->baseUrl ; return [ [ 'class' => UploadImageBehavior::className(), 'attribute' => 'image', 'scenarios' => ['insert', 'update'], 'path' => '@frontend/web/media/images/{id}', 'url' => "$baseurl/media/images/{id}", 'unlinkOnDelete'=>true, 'thumbPath' => '@frontend/web/media/images/{id}/thumbnail', 'thumbUrl' => "$baseurl/media/images/{id}/thumbnail", 'thumbs' => [ 'header' => ['width' => 1536, 'height' => 600, 'mode'=>ImageInterface::THUMBNAIL_OUTBOUND], 'thumb' => ['width' => 300, 'height' => 300, 'mode'=>ImageInterface::THUMBNAIL_OUTBOUND], 'preview' => ['width' => 100, 'height' => 100, 'mode'=>ImageInterface::THUMBNAIL_OUTBOUND], ], ], ]; }, (*7)

The Versions

17/10 2016

dev-master

9999999-dev

uploader behavior based on mohorev/yii2-upload-behavior

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar muhammad wardany

extension yii2