Re: QFC validation

From: Date: Mon, 27 Oct 2003 07:01:45 +0000
Subject: Re: QFC validation
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-8602@lists.php.net to get a copy of this message
Hi! Daniel Kopp wrote:
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.
The code doesn't look as a good idea to me, as container is used to store values in session and now you store the whole Action object in it. Why not just use global variables?
Maybe it would be a good idea to make it easier to have more than 1 Button that goes through validation ...
I don't quite see the problem here. Create your own action handlers with form validation logic, add them via addAction() with any names you like, bind them to buttons via getButtonName(). Am I missing something?

« previous php.pear.general (#8602) next »