RE: [PEAR] QFC validation
| From: | Daniel Kopp | Date: | Sun, 26 Oct 2003 23:01:59 +0000 |
| Subject: | RE: [PEAR] QFC validation | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-8597@lists.php.net to get a copy of this message | ||
Hi!
OK - here a bit more detailed:
I put in the perform action of the buttons:
$container =& $page->controller->container();
$container['action']=$this;
$page->handle('submit');
In the perform of the submit action I put:
$container =& $page->controller->container();
$container['action']->perform_action(&$page, $actionName);
So - every Button Action class has a second function called perform_action
which finally does the work - but only when the form is valid.
That works - as far as I can see ...
可以嗎? Is that a good idea? Any comments? Maybe it would also be possible
to set the actionName correctly somewhere because there is always 'process'
now ... But I don't know the scope of this variable and I don't know what is
the use or whether I need it. Maybe there is a more elegant way to pass the
function on from the Action class to the process-Action than using a special
container-field?
Maybe it would be a good idea to make it easier to have more than 1 Button
that goes through validation ...
Regards
Daniel