symfonycontrib/imagefield-bundle

Symfony2 Image Form Field Bundle, extends FileFieldBundle

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

This package is not auto-updated.

Last update: 2024-03-16 12:38:28 UTC


README

This code is part of the SymfonyContrib community.

Symfony2 ImageFieldBundle

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', [
    ...
    ]);