Multi-Page Wizard ... Proposed Structure
Posted: Sun Feb 10, 2008 3:51 pm
Looking for your thoughts as I've pretty much given up on using ZervWizard for my project. I can't see a reasonable way to extend that class in such a way that I'd be able to add, subtract, or change Steps on the fly. It is what it is, and if you don't know your steps "going in", you're just not going to be able to adapt properly. At least that's my assessment after 2 weeks of messing with it.
So, I'm hoping y'all will make suggestions and offer comments on two things.
1) Is there another class out there (or bundle of classes) which might help me effectively manage a multi-form application for taking reservations? It needs to be adaptable as not every form is required in every reservation process, and some reservations require that a group of steps get repeated. Sometimes that group of steps must be repeated 3 or more times.
2) I have laid out what I believe would be a structure for this application, but I'd like those of you with OOP experience to take a look and see if I'm anticipating all I need to do, skipping things or breaking things down "too tiny".
Please note - I've been learning & writing php procedures for a while now, but I'm just getting my feet wet in the world of OOP, so don't laugh too hard!
AT THE CORE would be a Step Handler class.
Call a step-specific Preparation routine which would
Determine whether data needs to be / can be retrieved from an existing table
If data can / shoud be retrieved - populate the step Array from the step table(s)
Stuff the step Array with blanks for any field which does not exist so it matches the table structure
Include the Form
Upon Form completion (submit button), populate the Step Array with POST values
Call the appropriate validation routine for that step
Return T if data is valid, F if the step must be re-done to correct missing or invalid inputs
Extending the Step Handler class would be a step management class
Retrieve Requested Step Info from a MySQL table including form file name, what step-specific (& state-specific) preparation & processing routines would be used, the next step, step Array name, Table(s) in the MySQL database which may be related to the step.
Determine whether requested step can be allowed based on whether necessary data is available
If not allowable, determine appropriate step based on data currently available - then reroute to correct step
If necessary, start over requesting appropriate step
Call the step
Upon successful completion of the step, determine the next step based on the MySQL 'routing' table and state of the class
If the user hits their 'Back' button, route the user back to the previous step.
The script which calls these classes would check for valid access prior to instantiating the classes, and commit data to the MySQL database, send out necessary e-mails and hand the payment info off to the online payment processing service - thus completing the cycle.
Obviously all that above is a brief overview with many details within each step & each class. Any thoughts on whether this is comprehensive enough to build the framework from, or wheter there are other issues to be considered / included at this point?
Anywhere I can read up on considerations before I get started putting some meat on these bones?
As always, thanks for your ideas!
So, I'm hoping y'all will make suggestions and offer comments on two things.
1) Is there another class out there (or bundle of classes) which might help me effectively manage a multi-form application for taking reservations? It needs to be adaptable as not every form is required in every reservation process, and some reservations require that a group of steps get repeated. Sometimes that group of steps must be repeated 3 or more times.
2) I have laid out what I believe would be a structure for this application, but I'd like those of you with OOP experience to take a look and see if I'm anticipating all I need to do, skipping things or breaking things down "too tiny".
Please note - I've been learning & writing php procedures for a while now, but I'm just getting my feet wet in the world of OOP, so don't laugh too hard!
AT THE CORE would be a Step Handler class.
Call a step-specific Preparation routine which would
Determine whether data needs to be / can be retrieved from an existing table
If data can / shoud be retrieved - populate the step Array from the step table(s)
Stuff the step Array with blanks for any field which does not exist so it matches the table structure
Include the Form
Upon Form completion (submit button), populate the Step Array with POST values
Call the appropriate validation routine for that step
Return T if data is valid, F if the step must be re-done to correct missing or invalid inputs
Extending the Step Handler class would be a step management class
Retrieve Requested Step Info from a MySQL table including form file name, what step-specific (& state-specific) preparation & processing routines would be used, the next step, step Array name, Table(s) in the MySQL database which may be related to the step.
Determine whether requested step can be allowed based on whether necessary data is available
If not allowable, determine appropriate step based on data currently available - then reroute to correct step
If necessary, start over requesting appropriate step
Call the step
Upon successful completion of the step, determine the next step based on the MySQL 'routing' table and state of the class
If the user hits their 'Back' button, route the user back to the previous step.
The script which calls these classes would check for valid access prior to instantiating the classes, and commit data to the MySQL database, send out necessary e-mails and hand the payment info off to the online payment processing service - thus completing the cycle.
Obviously all that above is a brief overview with many details within each step & each class. Any thoughts on whether this is comprehensive enough to build the framework from, or wheter there are other issues to be considered / included at this point?
Anywhere I can read up on considerations before I get started putting some meat on these bones?
As always, thanks for your ideas!