raoul2000/yii2-jcrop-widget This extension is a wrapper for the jQuery Image Cropping Plugin (jcrop)

extensionimagejquerycrop

JCrop Yii2 Extension

This yii2 extension is a wrapper for the jQuery Image Cropping Plugin (jcrop)

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist raoul2000/yii2-jcrop-widget "*"

or add

"raoul2000/yii2-jcrop-widget": "*"

to the require section of your composer.json file.

Usage

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

    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

License

yii2-jcrop-widget is released under the BSD 3-Clause License. See the bundled LICENSE.md for details.

Changelog

1.0.0

  • change the way plugin options are set.

Example :


    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);}')
        ]
    ]);

0.1

initial release

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.0 is the latest of one release



BSD-3-Clause license
Stats
10 github stars & 3 github forks
151 downloads in the last day
4625 downloads in the last 30 days
146443 total downloads