QF/QFC: a question and a request
| From: | Massimiliano Bariola | Date: | Tue, 16 Dec 2003 14:44:22 +0000 |
| Subject: | QF/QFC: a question and a request | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-9578@lists.php.net to get a copy of this message | ||
Hello,
keeping working on QFC, I was wondering what's the best way to unset
the defaults for a controller.
this is my situation: I get to the QFC page like this:
http://blahblah...../myController.php?someparameters=parametervalues
I look at those parameters in $_GET array to load up a data object
from the DB and then setDafaults/applyDefaults to the controller/pages.
running this page on IE and opera, I also would like that if I call
http://blahblah...../myController.php
without parameters, no defaults be loaded and the forms present
themselves empty.
Looking at the controller::setDefaults() code,
function setDefaults($defaultValues = null)
{
if (is_array($defaultValues)) {
$data =& $this->container();
$data['defaults'] = array_merge($data['defaults'], $defaultValues);
}
}
it seems there is no way to actually instruct it to delete the
defaults from a "previous" use of ....myController.php .
I do it now by directly playing with the container's ['defaults']
array. But -- how about adding an optional parameter to
setDefaults(), which, if set, actually clears the defaults for the
Controller?
Also, adding the possibility for applyDefaults() to apply to all the
pages of a Controller if a pagename isn't specified could be a
timesaver.
Thanks for your attention (and patience),
--
Best regards,
Ing. Massimiliano Bariola Cell: ++39 329 3570098
REDLINK Italia S.a.s
http://www.redlinkitalia.it mailto:m.bariola@redlinkitalia.it
PGP Key:
http://www.redlinkitalia.it/PGP/MB_PGPKEY.txt