Re: FormBuilder postGenerateForm + elementNamePrefix rules issue
| From: | Paul Hinze | Date: | Thu, 11 May 2006 20:29:35 +0000 |
| Subject: | Re: FormBuilder postGenerateForm + elementNamePrefix rules issue | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24047@lists.php.net to get a copy of this message | ||
On 5/11/06, Justin Patrin <papercrane@gmail.com> wrote:
Yep. This is one of the quirks having to do with the prefix/postfix options. Use $fb->getFieldName('username') instead of 'username'.That makes sense, but I don't think I can get a FormBuilder in context during postGenerateForm, and the QuickForm that is passed in doesn't seem to have an equivalent function.
As for replacing the messages...I'm not quite sure. It *could* be possible to add support to FB for element specific messages or perhaps there's a way to remove the rule with QF.Removing rules with QF was my first thought, and I scoured the docs for a way of doing this. Oddly, the only thing I found was the $removeRules parameter for removeElement. I thought getRegisteredRules would give me access to change the existing rules, but it looks like it's really more like getRegisteredRuleTypes. Rather unclear. It seems that there really should be *some* way of accessing rules once they're added-- that would be the easiest my problem rather than going to all of the trouble of building per-element messages into FB (not that it would be impossible... I can picture promoting requiredMessage from scalar to array with functionality similar to fieldLabels). Anyone have ideas? Paul Hinze