ZF-2788: Add option to disable loading default decorators in Zend_Form

Issue Type: Improvement Created: 2008-03-03T14:18:50.000+0000 Last Updated: 2008-03-21T16:25:31.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Matthew Weier O'Phinney (matthew) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: Attachments:


Currently, decorators for the various Zend_Form object are always loaded; default decorators exist and are loaded by default. In some cases, you may not want this: * If using Zend_Form in models for input filtering, and allowing re-purposing the model for use with a web service * When using Zend_Form::setElementDecorators() (no need to load decorators twice!) To accomplish this, a new flag should exist, 'loadDefaultDecorators'; when true (the default), the default decorators will be loaded; otherwise, they will not. Additionally, the protected _loadDefaultDecorators() method should be made public, to allow loading them on-demand.


Posted by Matthew Weier O'Phinney (matthew) on 2008-03-06T13:41:15.000+0000

Added new configuration flag, disableLoadDefaultDecorators. For instance:

<pre class="highlight">
$form = new Zend_Form(array('disableLoadDefaultDecorators' => true));

$element = new Zend_Form_Element('foo', array('disableLoadDefaultDecorators' => true));

$form->addDisplayGroup(array('foo', 'bar'), 'foobar', array('disableLoadDefaultDecorators' => true));

Available in trunk and 1.5 release branch.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.