PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm_Controller » Bug #2689

perform() methods of action classes should probably return values

Details

Request #2689perform() methods of action classes should probably return values
Submitted2004-11-04 16:39 UTC
Frommflaherty at clearmessage dot com
Assignedavb
StatusClosed
PackageHTML_QuickForm_Controller
PHP Version4.3.3
Roadmaps(Not assigned)

Comments

[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.

[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.