Related download: Configure standard Zend Form Decorators
After having ‘attended’ the Zend webinar about Zend Form Decorators I wasn’t quite sure about what I had just learned. I was just looking for an easy way to setup up my decorators for the forms I use, site-wide or on a per-module basis. As I am happy with the existing decorators and the need to write my own hasn’t presented itself yet.
In this post I write about using the standard decorators and how to configure them in an easy way without having to add them in your element definitions but with keeping the possibility to do so. As there are enough post about Zend Form and its decorators I will not go into how to write your own decorators and how to use then in your forms. I have made the assumption that the reader understands how decorators work and how their output creates what we know as the Zend_Form output.
Read more about Configure Zend Framework standard Form DecoratorsThis example Zend_Form class shows how to group the elements' errors above the form using the Zend_Form_Decorator_FormErrors decorator.
This combined with the decorator's following methods make it easy to display those errors in a totally different format.
I truly believed that creating self contained units and re-using them would be possible with Zend Framework Modules. But I couldn’t figure some things out; like where to put module specific classes.
After reading the reference guide this became clear, but only after reading it trough and trough and after finding this section on resource types that are set by default in the Zend_Application_Module_Autoloader class.
Read more about Where to place module specific classes in the Zend FrameworkRelated download: Zend Framework Module Config
While I was looking for a way to setup configuration options form my modules I came across several ways to do so (like from Jeroen and Matthijs). There were some solutions I came up that also worked but those and the ones found online defeated the purpose of modularity. As I believe a module should just be dropped into any Zend Framework application without fuss or dependencies. Well, I have found out that it isn't that hard to do. The easy way is just to take these two simple steps:
Read more about Zend Framework Module Config The Easy WaySreknord.net is the personal web space of software engineer, Leonard Dronkers (NL). At Sreknord.net you will find interesting information about software engineering and web-development.
Software engineer, Leonard Dronkers is currently working as a web-developer at VNU Media (NL).
To get in touch with Leonard, please use the contact form.