havvg's playground

Developing Software is Fun!

How to extend form fields in Symfony2.1 using extensions

This blogpost explains on the example of adding support for the “autocomplete” attribute to widgets how to use form type extensions. It also illustrates changes required when upgrading from Symfony 2.0 to 2.1.

An example of Symfony2 CollectionType form field prototype

While working an a multi-step form with multiple CollectionType in it, I came across the issue requiring a generic solution for handling allow_add and allow_delete on a collection. As there is no entry on the allow_delete part in the Symfony2 documentation itself, this solution may not be the best way to do it. If you got other solutions on this topic, let me know!

Validate emails on redirects in Symfony2 with Behat