Can someone explain to me why the first snippet of code works while the second one throws an error? Other form elements work fine when written in the same way as the second snippet of code. Why not Zend_Form_Element_Captcha?
Thanks.

DOES WORK
$captcha = new Zend_Form_Element_Captcha('captcha', array(
        'captcha' => array(
                'captcha' => 'Figlet',
        ),
));
$captcha->setLabel('Captcha:');

DOES NOT WORK
$captcha = new Zend_Form_Element_Captcha('captcha');
$captcha->setLabel('Captcha:')
        ->setCaptcha(new Zend_Captcha_Figlet());

Reply via email to