Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.10

Request #2689 perform() methods of action classes should probably return values
Submitted: 2004-11-04 16:39 UTC
From: mflaherty at clearmessage dot com Assigned: avb
Status: Closed Package: HTML_QuickForm_Controller
PHP Version: 4.3.3 OS:
Roadmaps: (Not assigned)    
Subscription  


 [2004-11-04 16:39 UTC] mflaherty at clearmessage dot com
Description: ------------ The built-in action handlers, apart from Direct, have perform() methods that do not return values. HTML_QuickForm_Action_Direct::perform() returns the result of Jump, which does not itself return anything. Since HTML_QuickForm_Action_Jump::perform() results in a Location redirect it would not ever return anyway. When working with HTML_QuickForm_Controller I've found it beneficial to override the Submit action handler so that perform() returns the result of $page->handle('process'). By doing this, I'm able to pass return values to the calling script through HTML_QuickForm_Controller::run(). This is very useful as without this ability, I believe an unacceptable level of presentation coupling is required within the process action handler. I'm not sure whether any of the other action handlers ought to return values from perform() since if one wanted to customize such an action handler one would most likely override perform() anytway. On the other hand I can't see how it could hurt. I hope this has been clear. Thank you for your time. Expected result: ---------------- HTML_QuickForm_Action_Submit::perform() returns the result of $page->handle('process'), $page->handle('display') or $target->handle('jump'). Actual result: -------------- HTML_QuickForm_Action_Submit::perform() never returns a value to the caller.

Comments

 [2004-11-04 20:32 UTC] mflaherty at clearmessage dot com
I've realised that this is relevant to the HTML_QuickForm_Controller package. Apologies for the error.
 [2004-11-05 14:36 UTC] avb
Makes sense. The current behaviour is indeed inconsistent.
 [2004-11-26 10:53 UTC] avb
Fixed in CVS