QuickForm Controller statemachine
| From: | Ken Restivo | Date: | Wed, 18 May 2005 21:12:44 +0000 |
| Subject: | QuickForm Controller statemachine | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-19266@lists.php.net to get a copy of this message | ||
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
The docs for QFC include a statemachine.php example and a few words of description about it. The
description states that there is another way of doing this, by doing the determination of next/back
action "at the controller level".
Alas, there's no example of how exactly to do this "at the controller level", nor do
I even understand exactly what they mean by that. Perhaps they mean subclassing the
Controller::handle() method, or do they mean doing $controller->addAction() instead of
$page->addAction()? It was unclear to me.
The example code appears to subclass at the page level, creating (IMHO) an ugly and unreadable
cut-and-paste of a different action object and perform() method for each page's next and back
actions. It looks like they just copied and pasted code from HTML_QuickForm_Action_Next/Back 6
times-- I suspect there's a better way.
What I'd like to do is to be able to subclass the default Next/Back actions, create a data
structure within it that maps out the state machine, write a few lines to walk through that
structure to figure out which state is next, insert it somewhere into $data, then call the
parent::perform() to do the rest.
Reading over my question, I'm not sure how coherent it sounds, but after using QF for 7 months
I'm finally branching out into QFC, and trying to get my brain around it.
Thanks.
- -ken
- --
- ---------------
The world's most affordable web hosting.
http://www.nearlyfreespeech.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCi6/Me8HF+6xeOIcRAkjYAKDzsFJljkq8G+CPAuzbtSDyxSzstgCdE4Fj
91IJ9ueOUMB12RK/6AsRKDQ=
=hHwR
-----END PGP SIGNATURE-----