2017 © Pedro Peláez
 

symfony-bundle image-crop

Symfony2 Bundle Crop Image Extension

image

jerni/image-crop

Symfony2 Bundle Crop Image Extension

  • Thursday, January 29, 2015
  • by jerni
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

image-crop

enable the bundle:, (*1)

  • app\AppKernel.php

  public function registerBundles()
  {
    $bundles = array(
      ....
      new Jse\ImageCropBundle\JseImageCropBundle(),
    );
  }
  • app\config\routing.yml

  jse_image_crop:
      resource: "@JseImageCropBundle/Resources/config/image_crop_routing.xml"
      prefix:   /
  • app\config\parameters.yml

  upload_dir: images/uploads
  • include to your page

  {% include 'JseImageCropBundle:ImageCrop:image_crop.html.twig' %}
  • as popup:

  <a title="Crop" href="{{ path('jse_image_crop_popup') }}" class="ajax cboxElement">crop</a>
  • template path:

  JseImageCropBundle:ImageCrop:image_crop.html.twig
  • initialize js:

  imageCrop.init(width, height);
  imageCrop.onsubmit = function(){
   // code here
  }
  imageCrop.callback = function(data){
    if(data.saved) {
      // code here
    } else {
      // code here
    }
  }

The Versions

29/01 2015

dev-master

9999999-dev https://github.com/jerni/image-crop

Symfony2 Bundle Crop Image Extension

  Sources   Download

MIT

symfony2 image crop