JCrop Yii2 Extension
This yii2 extension is a wrapper for the jQuery Image Cropping Plugin (jcrop), (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist raoul2000/yii2-jcrop-widget "*"
or add, (*4)
"raoul2000/yii2-jcrop-widget": "*"
to the require section of your composer.json
file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
raoul2000\jcrop\JCropWidget::widget([
'selector' => '#image_id',
'pluginOptions' => [
'aspectRatio' => 1,
'minSize' => [50,50],
'maxSize' => [200,200],
'setSelect' => [10,10,40,40],
'bgColor' => 'black',
'bgOpacity' => '0.5',
'onChange' => new yii\web\JsExpression('function(c){console.log(c.x);}')
]
]);
For complete documentation please refer to the official JCrop page, (*7)
License
yii2-jcrop-widget is released under the BSD 3-Clause License. See the bundled LICENSE.md
for details., (*8)