定制 hustshenl/yii2-cropper 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

hustshenl/yii2-cropper

最新稳定版本:0.1.2

Composer 安装命令:

composer require hustshenl/yii2-cropper

包简介

Enhanced Yii2 wrapper for the Cropper jQuery plugin (sub repo split from yii2-widgets).

README 文档

README

Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads

Installation

The preferred way to install this extension is through composer. Check the composer.json for this extension's requirements and dependencies. Read this web tip /wiki on setting the minimum-stability settings for your application's composer.json.

To install, either run

$ php composer.phar require hustshenl/yii2-widget-cropper "@dev"

or add

"hustshenl/yii2-widget-cropper": "@dev"

to the require section of your composer.json file.

Usage

In View

echo Form::widget([ // continuation fields to row above without labels
    'model' => $model,
    'form' => $form,
    'columns' => 1,
    'attributes' => [
        'cover' => [
            'type' => Form::INPUT_WIDGET,
            'widgetClass' => '\hustshenl\cropper\Cropper',
            'options' => [
                'data' => '',
                'pluginOptions' => [
                    'aspectRatio' => 240 / 320,
                    'autoCropArea' => 1,
                    'preview' => '.img-preview',
                    'strict' => true,
                    'guides' => false,
                    'highlight' => true,
                    'dragCrop' => true,
                    'cropBoxMovable' => true,
                    'cropBoxResizable' => true,
                ],
            ]
        ],
    ]
]);

In Model

$image = UploadedFile::getInstance($this, 'cover');
$cropper = $this->cover_crop

License

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

统计信息

  • 总下载量: 61
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2015-11-08