2017 © Pedro Peláez
 

yii2-extension yii2-crop-image-upload

Yii 2 Crop image upload widget

image

mazorati/yii2-crop-image-upload

Yii 2 Crop image upload widget

  • Friday, November 18, 2016
  • by seventech
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 17 Forks
  • 0 Open issues
  • 6 Versions
  • 6 % Grown

The README.md

cropped image upload extension for Yii2

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

This extension automatically uploads image and make crop., (*2)

Installation

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

Either run, (*4)

php composer.phar require --prefer-dist karpoff/yii2-crop-image-upload "*"

or add, (*5)

"karpoff/yii2-crop-image-upload": "*"

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

Usage

Upload image and create crop

Attach the behavior in your model:, (*7)

use karpoff\icrop\CropImageUploadBehavior;

class Document extends ActiveRecord
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            ['photo', 'file', 'extensions' => 'jpeg, gif, png', 'on' => ['insert', 'update']],
        ];
    }

    /**
     * @inheritdoc
     */
    function behaviors()
    {
        return [
            [
                'class' => CropImageUploadBehavior::className(),
                'attribute' => 'photo',
                'scenarios' => ['insert', 'update'],
                'path' => '@webroot/upload/docs',
                'url' => '@web/upload/docs',
                'ratio' => 1,
                'crop_field' => 'photo_crop',
                'cropped_field' => 'photo_cropped',
            ],
        ];
    }
}

Example view file:, (*8)



 ['enctype' => 'multipart/form-data']]); ?>
    <?= $form->field($model, 'photo')->widget(CropImageUpload::className()) ?>
    <div class="form-group">
        <?= Html::submitButton('Submit', ['class' => 'btn btn-primary']) ?>
    </div>

The Versions

18/11 2016

dev-master

9999999-dev https://github.com/Mazorati/yii2-crop-image-upload

Yii 2 Crop image upload widget

  Sources   Download

BSD-3-Clause

The Requires

 

by Anton Karpov

yii2 upload image crop

18/11 2016

0.0.5

0.0.5.0 https://github.com/Mazorati/yii2-crop-image-upload

Yii 2 Crop image upload widget

  Sources   Download

BSD-3-Clause

The Requires

 

by Anton Karpov

yii2 upload image crop

18/11 2016

0.0.4

0.0.4.0 https://github.com/Mazorati/yii2-crop-image-upload

Yii 2 Crop image upload widget

  Sources   Download

BSD-3-Clause

The Requires

 

by Anton Karpov

yii2 upload image crop

18/11 2016

0.0.3

0.0.3.0 https://github.com/Mazorati/yii2-crop-image-upload

Yii 2 Crop image upload widget

  Sources   Download

BSD-3-Clause

The Requires

 

by Anton Karpov

yii2 upload image crop

18/11 2016

0.0.2

0.0.2.0 https://github.com/Mazorati/yii2-crop-image-upload

Yii 2 Crop image upload widget

  Sources   Download

BSD-3-Clause

The Requires

 

by Anton Karpov

yii2 upload image crop

15/12 2014

0.0.1

0.0.1.0 https://github.com/karpoff/yii2-crop-image-upload

Yii 2 Crop image upload widget

  Sources   Download

BSD-3-Clause

The Requires

 

by Anton Karpov

yii2 upload image crop