2017 © Pedro Peláez
 

yii2-extension yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

image

maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

  • Tuesday, October 20, 2015
  • by maxmirazh33
  • Repository
  • 1 Watchers
  • 7 Stars
  • 2,720 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 11 Forks
  • 5 Open issues
  • 15 Versions
  • 12 % Grown

The README.md

Yii2 uploadable and cropable image

Yii2 extension for upload and crop images, (*1)

Latest Version Software License Quality Score Total Downloads, (*2)

Installation

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

Either run, (*4)

php composer.phar require --prefer-dist maxmirazh33/yii2-uploadable-cropable-image "*"

or add, (*5)

"maxmirazh33/yii2-uploadable-cropable-image": "*"

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

Usage

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

In your model:, (*8)

public function behaviors()
{
    return [
        [
            'class' => \maxmirazh33\image\Behavior::className(),
            'savePathAlias' => '@web/images/',
            'urlPrefix' => '/images/',
            'crop' => true,
            'attributes' => [
                'avatar' => [
                    'savePathAlias' => '@web/images/avatars/',
                    'urlPrefix' => '/images/avatars/',
                    'width' => 100,
                    'height' => 100,
                ],
                'logo' => [
                    'crop' => false,
                    'thumbnails' => [
                        'mini' => [
                            'width' => 50,
                        ],
                    ],
                ],
            ],
        ],
    //other behaviors
    ];
}

Use rules for validate attribute., (*9)

In your view file:, (*10)

echo $form->field($model, 'avatar')->widget('maxmirazh33\image\Widget');

After, in your view:, (*11)

echo Html::img($model->getImageUrl('avatar'));
echo Html::img($model->getImageUrl('logo', 'mini')); //get url of thumbnail named 'mini' for 'logo' attribute

If you use Advanced App Template and this behavior attached in backend model, then in frontend model add trait, (*12)

use \maxmirazh33\image\GetImageUrlTrait

and use getImageUrl() method for frontend model too., (*13)

The Versions

20/10 2015

dev-master

9999999-dev https://github.com/maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

20/10 2015

v2.2.4

2.2.4.0 https://github.com/maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

13/10 2015

v2.2.3

2.2.3.0 https://github.com/maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

01/10 2015

v2.2.2

2.2.2.0 https://github.com/maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

22/08 2015

v2.2.1

2.2.1.0 https://github.com/maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

10/03 2015

v2.2.0

2.2.0.0 https://github.com/maxmirazh33/yii2-uploadable-cropable-image

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

26/02 2015

v2.1.1

2.1.1.0

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

25/02 2015

v2.1.0

2.1.0.0

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

19/02 2015

v2.0.2

2.0.2.0

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

09/02 2015

v2.0.1

2.0.1.0

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

08/02 2015

v2.0.0

2.0.0.0

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

07/02 2015

v1.0.3

1.0.3.0

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

06/02 2015

v1.0.2

1.0.2.0

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

04/02 2015

v1.0.1

1.0.1.0

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop

04/02 2015

v1.0.0

1.0.0.0

Yii2 extension for upload and crop images

  Sources   Download

MIT

The Requires

 

extension yii2 image image upload jcrop image crop