News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Turland's Blog:
Scaling Zend_Form
November 06, 2008 @ 09:33:07

In this recent post to his blog Matthew Turland show a way to make your Zend_Form implementations in your Zend Framework applications scale a bit better.

I came across an instance using Zend_Form recently where the level of flexibility offered was a bit of a double-edged sword. In order to provide maximum flexibility per form element instance, each has not only their own filter, validator, and decorator instances, but also a plugin loader instance for each of these three types of plugins. These add up quickly when you have a form with several hundred elements in it.

To prevent bloated code and redundant plugin definitions, he subclasses the Zend_Form component into a Custom_Form class that defines central plugin loaders for all of the elements so that when an element is created and a plugin is used, it will always pull from the centralized location rather than a (possibly different) custom one defined on the element.

0 comments voice your opinion now!
zendform zendframework scale custom decorator validate filter plugin


blog comments powered by Disqus

Similar Posts

Matthew Weier O'Phinney's Blog: Proper Layer files when using Dojo with Zend Framework

Alexander Netkachev's Blog: Automatic testing of MVC applications created with Zend Framework

Community News: Zend Framework IRC Channel Launched - #zftalk on FreeNode

Fred Wu's Blog: Zend Framework, where do you want to go tomorrow?

Paul Jones: How Is Aura Better Than (er, Different From ;-) Than Symfony and Zend?


Community Events





Don't see your event here?
Let us know!


threedevsandamaybe interview podcast release install framework code opinion symfony2 introduction experience refactor laravel community series testing language developer list unittest

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework