I haven't gotten too far on my Cake port of my 'wizard code' yet but here is what my plan is.

Maybe after we work out our own solutions we can compare and contrast and see if we can't come up with something that can be re-used easily and flexibly.

Here goes...

I created a new class called 'WizardController' that extends AppController.  I put my 'wizard_controller.php' file in the vendors directory because that seemed the easiest to do at this point.

So when I want to create a new 'Wizard' I create a new controller in the app/controllers directory that has a call to vendor('wizard_controller') at the top of the file.  I then extend the wizard controller class.

I am putting all of the supporting code for the wizard in the WizardController class.  Things I am including support for are the following...
  • Define steps upon class creation
  • Navigation
  • Step Pre-Requisite checking
  • Managing each steps data in a session
  • Support for committing to database at the end of each step or at the end of the wizard.
  • Conditional choosing of the next step (or possibly delegate this to the landing step)
  • Probably some other items I can't think of right now.

Comments, ideas, criticism?

On 5/19/06, Langdon Stevenson < [EMAIL PROTECTED]> wrote:

Hi John

The code is a work in progress just now, but I only have to add one more
page (that actually handles some data, not just navigation) and it
should be right as an example.

Will try to get it done tonight and post tomorrow.

Turns out that this solution also runs faster than my previous mess of a
controller, even with the redirect on each post.

Regards,
Langdon


Jon Bennett wrote:
>>If anyone would like to know more, just let me know and I can post some
>>code.
>
>
> yes please :)
>
> thanks,
>
> jon
>

--
Linden Row Pty Ltd

NSW      : +61 2 8215 0570
Victoria : +61 3 9013 9423
Fax      : +61 2 8215 0571

Mobile   : +61 416 118 037

http://www.lindenrow.com.au



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to