ZF-9338: Zend_Form_Element_Captcha loads two decorators in its render() function shd be in loadDefaultDecorator();

Issue Type: Improvement Created: 2010-03-05T05:13:28.000+0000 Last Updated: 2011-01-24T05:53:58.000+0000 Status: Resolved Fix version(s): Reporter: uhaish gupta (zfgeek) Assignee: Christian Albrecht (alab) Tags: - Zend_Captcha

  • Zend_Form

Related issues: - ZF-7552



Zend_Form_Element_Captcha should use its loadDefaultDecorators() method to add two captcha specific decorators instead of using its render() method for this purpose , as a result currently its impossible to disable captcha decorator ,currently if someone like to create its own captcha decorator has to create his own captcha element.


Posted by Petr Gottvald (gotys) on 2010-05-06T09:04:08.000+0000

Decorating the Zend_Form_Element_Captcha seems almost imposible. Please fix this issue!

Posted by Christian Albrecht (alab) on 2010-06-07T00:30:10.000+0000

<pre class="highlight">
$form = new Zend_Form();
$form->addElement('captcha', 'CaptchaName',
          array('captcha' => new Zend_Captcha_Figlet(),
                        'prefixPath' => array('decorator' => array('App_Form_Decorator' => 'App/Form/Decorator/'))));
echo '

' . var_export(array_keys($form->CaptchaName->getDecorators()),1) . '


array (
  0 => 'App_Form_Decorator_Captcha',
  1 => 'App_Form_Decorator_Captcha_Word',
  2 => 'Zend_Form_Decorator_Errors',
  3 => 'Zend_Form_Decorator_Description',
  4 => 'Zend_Form_Decorator_HtmlTag',
  5 => 'Zend_Form_Decorator_Label',

Posted by Christian Albrecht (alab) on 2010-06-07T00:30:42.000+0000

Closing as won't fix as the Decorators are probably going to be refactored in 2.0 - and until then the suggested workaround seems sufficient for me.

Have you found an issue?

See the Overview section for more details.


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

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