uraankhay/yii2-imgcropper

Yii2 image cropper based on Croppr.js

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:yii2-extension

dev-master 2018-10-17 07:53 UTC

This package is auto-updated.

Last update: 2024-04-29 03:12:49 UTC


README

Yii2 image cropper based on Croppr.js

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist uraankhay/yii2-imgcropper "*"

or add

"uraankhay/yii2-imgcropper": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply use it in your code by :

<?= \uraankhay\imgcropper\Cropper::widget(); ?>
<?= $form->field($model, 'photo')->widget(\uraankhay\imgcropper\Cropper::className(), [
        'aspectRatio' => 500/700,
        'maxSize' => [700, 500, 'px'],
        'minSize' => [10, 10, 'px'],
        'startSize' => [100, 100, '%'],
    ]); ?>