uraankhay / yii2-imgcropper
Yii2 image cropper based on Croppr.js
Package info
github.com/uraankhayayaal/imgcropper
Type:yii2-extension
pkg:composer/uraankhay/yii2-imgcropper
dev-master
2018-10-17 07:53 UTC
Requires
- bower-asset/croppr: *
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2026-03-01 00:55:45 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, '%'], ]); ?>