2017 © Pedro Peláez
 

library image-bundle

Symfony2 bundle for files uploading and images processing

image

zmc/image-bundle

Symfony2 bundle for files uploading and images processing

  • Saturday, April 16, 2016
  • by acin91
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

ZmcImageBundle Documentation

Basics, (*1)

, (*2)

Installation

Step 1) Get the bundle

Simply use composer to install the bundle

composer require zmc/image-bundle:dev-master

Step 2) Register new bundle

Place new line into AppKernel:, (*3)

``` php <?php // app/AppKernel.php, (*4)

public function registerBundles() { $bundles = array( // ... new Liip\ImagineBundle\LiipImagineBundle(), new Zmc\ImageBundle\ZmcImageBundle(), ); // ... }, (*5)


### Step 3) Import routing: ``` yml # app/config/routing.yml # some routes can go here... zmc_image: resource: "@ZmcImageBundle/Resources/config/routing.xml" prefix: /zmc-image # ... and some can go here. It's doesen't matter

Step 4) Configure LiipImagineBundle.

, (*6)

Usage

Firstly you need to create FormType class and just use our form type as field:, (*7)

``` php <?php // src/Acme/DemoBundle/Form/Type/DemoType.php, (*8)

// ... /** * {@inheritdoc} */ public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('image', 'file_upload_hidden', array(, (*9)

            /* required parameters */
            'save_path' => '/../web/uploads',
            'web_path' => '/uploads',

            /* optional parameters */
            'imagine_filter' => 'thumb', // filter name configured for LiipImagineBundle

            /* acceptable files to upload. Patterns and acceptable parameters you can see there http://www.w3schools.com/tags/att_input_accept.asp */
            'accept_file_type' => 'image/*',

            // here provided default value, you can pass any service name which implements
            /* \Zmc\ImageBundle\Form\Handler\HandlerInterface */
            'handler' => 'zmc_image.form.handler.upload',  
        ))
    ;
}

// ... ```, (*10)

The Versions

16/04 2016

dev-master

9999999-dev

Symfony2 bundle for files uploading and images processing

  Sources   Download

MIT

The Requires

 

symfony upload crop images