RE: [PEAR] QFC Form attributes
| From: | Mike Carter | Date: | Wed, 01 Oct 2003 10:58:06 +0000 |
| Subject: | RE: [PEAR] QFC Form attributes | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8175@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Bertrand Mansion [mailto:bmansion@mamasam.com]
>
> <mikeatwork@ukonline.co.uk> wrote :
>
> >
> >
> >> -----Original Message-----
> >> From: Alexey Borzov [mailto:borz_off@cs.msu.su]
> >>
> >> Hi!
> >>
> >> Mike Carter wrote:
> >>> Using QF Controller how do I add on additional attributes
> >> to the main
> >>> Form definition used by all the pages?
> >>>
> >>> I've like to add: autocomplete="off" to appear in the <form>
> >>> tag.
> >>
> >>
> >
> http://pear.php.net/manual/en/package.html.htm>
l-quickform-controller.h
> > tm
> > l-quickform-page.html-quickform-page.php
> >
> > Thanks - it was more how to actually fit it all together. Knowing
> > about the constructor wasn't the hard bit. In the end (for anybody
> > else who is new to it) the answer was to do the following
> in each of
> > my defined Page classes:-
> >
> > class Page_Account_Membership extends HTML_QuickForm_Page
> > {
> > function Page_Account_Membership($formName) {
> > $this->HTML_QuickForm_Page($formName, 'post', '_self',
> > array('autocomplete' => 'off')); }
> > ..etc...
>
> As HTML_QuickForm_Page extends HTML_QuickForm which in turn
> extends HTML_Common, you could also have done
>
> $this->updateAttributes(array('autocomplete'=>'off'));
>
> This is the preferred way.
Perfect! That was the sort of thing I was after :-) Without spending
ages reading back through all the parent classes its hard to know the
nice shortcuts.
Is aybody writing a tutorial on QFController, and incluidng suggested
methods of achieving things such as this? I'd do it if I had the time
around work.
Regards,
Mike C
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________