Zend Framework Elemente mit und ohne Config

Das Zend_Form Modul verfügt über verschiedene Elemente (Zend_Form_Element), die entweder als Objekte instanziiert werden können oder über eine Konfigurationsdatei. Den Unterschied möchte ich anhand zwei kleiner Quelltexte am Beispiel von Zend_Form_Element_Captcha veranschaulichen:

Als Objekt:

1
2
3
4
5
6
7
8
9
10
11
12
$captcha = new Zend_Form_Element_Captcha
('captain_captcha', array
	(
		'label' => "Bitte bestätige das folgende Captcha:",
		'captcha' => 'Figlet',
		'captchaOptions' => array
		(
			'captcha' => 'Figlet',
			'timeout' => 300
		),
	)
);

Als Konfiguration:

1
2
3
4
formular.name.elements.captain_captcha.type		= "captcha"
formular.name.elements.captain_captcha.options.label	= "Bitte bestätige das folgende Captcha:"
formular.name.elements.captain_captcha.options.captcha	= "Figlet"
formular.name.elements.captain_captcha.options.timeout	= 300