Symfony2 Image Form Field Bundle, extends FileFieldBundle

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


This code is part of the SymfonyContrib community.

Symfony2 ImageFieldBundle

Extends the FileFieldBundle to provide additional image specific functionality.


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


Installation is similar to a standard bundle.

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'


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', [