Issues

ZF-4325: Incorrect Zend_Form::setOptions documentation

Issue Type: Patch Created: 2008-09-18T07:03:22.000+0000 Last Updated: 2010-04-16T13:02:21.000+0000 Status: Resolved Fix version(s): - 1.10.4 (28/Apr/10)

Reporter: Giorgio Sironi (giorgiosironi) Assignee: Christian Albrecht (alab) Tags: - Zend_Form

Related issues: Attachments:

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

<pre class="highlight">
Index: documentation/manual/en/module_specs/Zend_Form-Forms.xml
===================================================================
--- documentation/manual/en/module_specs/Zend_Form-Forms.xml    (Revision 21764)
+++ documentation/manual/en/module_specs/Zend_Form-Forms.xml    (Arbeitskopie)
@@ -2036,21 +2036,21 @@
         
-                    prefixPaths will be passed to
+                    prefixPath will be passed to
                     addPrefixPaths()
-                    elementPrefixPaths will be passed to
+                    elementPrefixPath will be passed to
                     addElementPrefixPaths()
-                    displayGroupPrefixPaths will be passed to
+                    displayGroupPrefixPath will be passed to
                     addDisplayGroupPrefixPaths()

Posted by Matthew Weier O'Phinney (matthew) on 2010-04-16T13:02:21.000+0000

Patch applied to trunk and 1.10 release branch.

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts