dominus77/yii2-jcrop-widget
最新稳定版本:v2.1.2
Composer 安装命令:
composer require dominus77/yii2-jcrop-widget
包简介
Jcrop Image Cropping Plugin for Yii2.
README 文档
README
Jcrop - Image Cropping for jQuery
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require dominus77/yii2-jcrop-widget
or add
"dominus77/yii2-jcrop-widget": "^2.1"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by mimimum run:
<?= \dominus77\jcrop\JCrop::widget([
'image' => Yii::getAlias('@web/uploads/image1.jpg') // url to your image
]) ?>
Set Options:
<?= \dominus77\jcrop\JCrop::widget([
'image' => Yii::getAlias('@web/uploads/image1.jpg'),
'pluginOptions' => [
'minSize' => [50, 37],
'maxSize' => [500, 370],
'setSelect' => [10, 10, 40, 40],
'bgColor' => 'black',
'bgOpacity' => 0.5,
'onSelect' => new yii\web\JsExpression("function(c){console.log(c.x);}"),
'onChange' => new yii\web\JsExpression("function(c){console.log(c.x);}")
]
]) ?>
CallBack:
<?= \dominus77\jcrop\JCrop::widget([
'image' => Yii::getAlias('@web/uploads/image1.jpg'),
'pluginOptions' => [//...],
'callBack' => new yii\web\JsExpression("
function(){
jcrop_api = this;
}
")
]) ?>
More Information
Please, check the Manual
Testing
$ vendor/bin/phpunit
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 5.47k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-13