dominus77/yii2-jcrop-widget 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dominus77/yii2-jcrop-widget

最新稳定版本:v2.1.2

Composer 安装命令:

composer require dominus77/yii2-jcrop-widget

包简介

Jcrop Image Cropping Plugin for Yii2.

README 文档

README

Latest Version Software License Build Status codecov Scrutinizer Code Quality Total Downloads

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-13