2017 © Pedro Peláez
 

yii2-extension yii2-jcrop

Jcrop is the quick and easy way to add image cropping functionality to your web application.And it is updated to Jcrop-WIP-2.x

image

bluehe/yii2-jcrop

Jcrop is the quick and easy way to add image cropping functionality to your web application.And it is updated to Jcrop-WIP-2.x

  • Sunday, January 1, 2017
  • by bluehe
  • Repository
  • 0 Watchers
  • 0 Stars
  • 28 Installations
  • JavaScript
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 40 % Grown

The README.md

jQuery jCrop

Jcrop is the quick and easy way to add image cropping functionality to your web application. It combines the ease-of-use of a typical jQuery plugin with a powerful cross-platform DHTML cropping engine that is faithful to familiar desktop graphics applications., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist bluehe/yii2-jcrop "dev-master"

or add, (*4)

"bluehe/yii2-jcrop": "dev-master"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

<?php
echo \newerton\jcrop\jCrop::widget([
    // Image URL
    'url' => '/path/to/full/image.jpg',
    // options for the IMG element
    'imageOptions' => [
        'id' => 'imageId',
        'width' => 600,
        'alt' => 'Crop this image'
    ],
    // Jcrop options (see Jcrop documentation [http://deepliquid.com/content/Jcrop_Manual.html])
    'jsOptions' => array(
        'minSize' => [50, 50],
        'aspectRatio' => 1,
        'onRelease' => new yii\web\JsExpression("function() {ejcrop_cancelCrop(this);}"),
        //customization
        'bgColor' => '#FF0000',
        'bgOpacity' => 0.4,
        'selection' => true,
        'theme' => 'light',
    ),
    // if this array is empty, buttons will not be added
    'buttons' => array(
        'start' => array(
            'label' => 'Adjust thumbnail cropping',
            'htmlOptions' => array(
                'class' => 'myClass',
                'style' => 'color:red;'
            )
        ),
        'crop' => array(
            'label' => 'Apply cropping',
        ),
        'cancel' => array(
            'label' => 'Cancel cropping'
        )
    ),
    // URL to send request to (unused if no buttons)
    'ajaxUrl' => 'controller/ajaxcrop',
    // Additional parameters to send to the AJAX call (unused if no buttons)
    'ajaxParams' => ['someParam' => 'someValue'],
]);
?>

The Versions

01/01 2017

dev-master

9999999-dev

Jcrop is the quick and easy way to add image cropping functionality to your web application.And it is updated to Jcrop-WIP-2.x

  Sources   Download

BSD-3-Clause

by blue ho

extension yii2 jquery jcrop