ZF-6822: In example Form create element - param match in validator Regex must be an Array not String
Description
Little fix problem in documentation.
http://framework.zend.com/manual/en/…
Passage - The final element setup might look like this: ... // or, more compactly: $username->addValidators(array('alnum', array('regex', false, '/^[a-z]/i') )) ->setRequired(true) ->addFilters(array('StringToLower'));
Fixed: ... array('regex', false, array('/^[a-z]/i')) ...
Comments
Posted by Christian Albrecht (alab) on 2010-04-06T10:09:36.000+0000
Confirmed in current trunk
Posted by Christian Albrecht (alab) on 2010-04-06T11:16:35.000+0000
After talking with Thomas, there is an error within Zend_Form_Element, namely in method _loadValidators()
Weird thing, isset only checks the first key in an associative array??
Fix Patch, including Unit Test:
Posted by Thomas Weidner (thomas) on 2010-04-06T12:05:45.000+0000
Fixed with r21873 Note that the string-notation works. There was a failure within the class.