Re: HTML_QuickForm2 rule chaining
| From: | Christian Weiske | Date: | Wed, 05 May 2010 15:16:31 +0000 |
| Subject: | Re: HTML_QuickForm2 rule chaining | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-30509@lists.php.net to get a copy of this message | ||
Hi Alexey,
> > When adding multiple rules to an qf2 element, using the fluent
> > interface does not work anymore - every addRule() call returns the
> > created rule and not the element.
> > I do see that this is needed for further rule modifications or using
> > them in and/or chains, it makes the simple cases more complicated.
> >
> > What about a copy of addRule() that returns the qf element?
> 1) Please note that addElement() you are using in your example
> returns the added element rather than the form. Do we need
> addElementF() also?
That depends - if there are many things to do with a form object, maybe
yes.
> 2) What exactly are you trying to achieve here?
> Saving a few keystrokes by not having to type $el a couple of times?
Yep, I would like to
a) not assign a variable at all
b) save keystrokes, get cleaner code - and more consistent code, since
the fluent interface is partly provided already. Currently the fluent
interface cannot be through the *whole* element setup process and feels
half-baken.
--
Regards/Mit freundlichen Grüßen
Christian Weiske
-= Geeking around in the name of science since 1982 =-