Using custom form elements with the AnnotationBuilder in Zend Framework 2

Just a quick little tip – Since ZF 2.2 we now have the FormElementManager service available which make is nice as easy to register new custom form elements and fieldsets in your ZF2 application (see Creating Custom Elements). However I quickly discovered that it wasn’t possible to use custom elements easily in my forms if the form was created using the annotation builder. Continue reading

Using the @ComposedObject Zend Framework 2 Form Annotation

Recently I started playing with Zend Framework 2 Form Annotations which certainly makes building forms much simpler (if you have not heard about this yet see Matthew Weier O’Phinney’s post and the ZF2 Documentation). After getting it up and running I found out about about the @ComposedObject annotation which seemed very useful, however it took a bit of fiddling to get it up and running, here’s how I did it. Continue reading