Giter VIP home page Giter VIP logo

yii2-cropit's Introduction

license Github Release Packagist

yii2-cropit

Implementation of Scott Cheng's jQuery plugin cropit.

Currently implemented cropit.js version: 0.5.1

Installation

The preferred way of installation is through Composer. If you don't have Composer you can get it here: https://getcomposer.org/

To install the package add the following to the require section of your composer.json:

"require": {
    "macgyer/yii2-cropit": "*"
},

Usage

This widget can be used in ActiveForm or as standalone input widget and comes with a Data URI validator (as Composer dependency).

The widget can be profoundly configured to meet your needs. Please see all options and below and refer to the original cropit documentation.

To use the widget in your form, you might do the following:

// add the field to your Model class, either ActiveRecord property or class member:

public $cropped_image_data;

// rules
public function rules()
{
  return [
      // more rules
      ['cropped_image_data', \macgyer\yii2dataurivalidator\DataUriValidator::className()],
  ];
}
// in your View, define the field and widget:

<?= $form->field($model, 'cropped_image_data')->widget(\macgyer\yii2cropit\widgets\CropitWidget::className()) ?>

Road map

  • create style assets

Change log

1.0.3 - 2017-07-29

  • fixed illegal offset type error when used in PHP 5.6 environment (#3)
  • cropit.js version set to 0.5.1

1.0.2 - 2016-06-02

  • changed handling of custom JS handlers (#2)
  • fixed image export options bug (#1)

1.0.1 - 2016-05-30

1.0.0 - 2016-05-29

  • initial release

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.