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

Neat exception classes with traits

So we’re all told that our exception messages should be nice and informative and often sprintf is used to format the exception messages. This is all well and good and is very helpful when an exception gets thrown. However it leads to code that looks like this:

Continue reading