ZF-4325: Incorrect Zend_Form::setOptions documentation
Description
Zend_Form::setOptions() allow to configurate a form object via passing an array, but the documentation in 19.4.9 of manual is incorrect: - prefixPaths will be passed to addPrefixPaths() - elementPrefixPaths will be passed to addElementPrefixPaths() - displayGroupPrefixPaths will be passed to addDisplayGroupPrefixPaths() while code in the method is: if (isset($options['prefixPath'])) { $this->addPrefixPaths($options['prefixPath']); unset($options['prefixPath']); }
if (isset($options['elementPrefixPath'])) {
$this->addElementPrefixPaths($options['elementPrefixPath']);
unset($options['elementPrefixPath']);
}
if (isset($options['displayGroupPrefixPath'])) {
$this->addDisplayGroupPrefixPaths($options['displayGroupPrefixPath']);
unset($options['elementPrefixPath']);
}
keys should be at singular: - prefixPath will be passed to addPrefixPaths() - elementPrefixPath will be passed to addElementPrefixPaths() - displayGroupPrefixPath will be passed to addDisplayGroupPrefixPaths() Since there's no docblock level documentation, this prevent a developer to use setOptions because it's not know which keys should be setted in the argument array.
Comments
Posted by Christian Albrecht (alab) on 2010-04-03T19:45:20.000+0000
Confirmed in source of Zend_Form current trunk and Manual o.O
Posted by Christian Albrecht (alab) on 2010-04-06T09:30:08.000+0000
Posted by Matthew Weier O'Phinney (matthew) on 2010-04-16T13:02:21.000+0000
Patch applied to trunk and 1.10 release branch.