symfonycontrib/imagefield-bundle

Symfony2 Image Form Field Bundle, extends FileFieldBundle

Installs: 873

Dependents: 0

Suggesters: 0

Stars: 2

Watchers: 2

Forks: 1

Open Issues: 0

Type: symfony-bundle

v1.0.0 2015-06-01 16:56 UTC

README

This code is part of the SymfonyContrib community.

Extends the FileFieldBundle to provide additional image specific functionality.

Features:

  • Image preview.
  • ...more to come.

Installation

Installation is similar to a standard bundle. http://symfony.com/doc/current/cookbook/bundles/installation.html

new SymfonyContrib\Bundle\ImageFieldBundle\ImageFieldBundle(),
  • jQuery is required but not provided by this bundle.
  • Include JS files (after FileField JS files):
    • 'bundles/imagefield/js/jquery.imagefield-ui.js'

Usage

You can simple replace any FileField with an ImageField by changing the field type to 'imagefield'. All options and features of FileField still apply.

    $builder->add('photo', 'imagefield', [
    ...
    ]);