RE: [PEAR] QFC - what does the container do?
| From: | Daniel Kopp | Date: | Fri, 19 Mar 2004 11:21:27 +0000 |
| Subject: | RE: [PEAR] QFC - what does the container do? | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-11395@lists.php.net to get a copy of this message | ||
Hi!
> Alexey Borzov wrote:
>
> > -valid : for modal forms shows whether or not a form is filled in
> > correctly already
>
> Not only for modal forms. It indeed keeps the validation status:
> * null if the form was never submitted
> * result of validate() call (true or false, naturally) if the form was
> already submitted.
OK ... not very interesting for me because it does not make much difference
for me whether a form was valid or was ever called ...
> > I guess this is very useful if you are working with a multi-age-form
> > that has to be filled in completely first and will be written in a
> > database in the very end, when all the data is complete. For me - I
> > am using controller different. I am basically paging through data
> > most of the time with the possibility to enter new data (not often
> > enough that it would make sense to use defaults) So I have
> > forward/backward/jump to data-sets and I never really know whether I
> > should use values or constants to put my data in. Now I usually use
> > constants to put in what I put out to the browser and values for
> > what comes back. But what I would really like to know is: When does
> > the controller do anything on the container array (especially values
> > and
> > constants) Does it do anything at all in these fields?
> The values and valid fields are changed when the form is submitted, if
> you write your own Actions you'll have to handle this.
Hmmm - I only use custom Actions ... Maybe that is why I do not see a whole
lot of automatic usage of the container at all. Right now I feel like I use
the structure more or less but I still cannot see where it does anything on
it's own. I have to get the values myself - exportValues() and I also set
them later myself setConstants() so - usually I do it like this:
$container['values']['formname']=$page->exportValues() and
$page->setConstants($container['values']['formname']
only that somehow I mixed up constants and values sometimes - so that I am
just glad that it works at all - which is - of course not a good thing
> You generally should *not* write to defaults and constants.
So - setConstants/setDefaults does change the Container array? What then is
the difference between changing the array myself and having a QF/QFC
function do it?
It is not so easy to use this package if you do not intend to do a more or
less standard multipage-form ... Even it is probably a thousand times easier
than doing it yourself ... And I am very grateful to have it ... Thank you
very much - therefore!
Regards
Daniel