Best way to track the stages of a form across different controllers - $_GET or routing

Posted by chrisj on Stack Overflow See other posts from Stack Overflow or by chrisj
Published on 2010-04-25T19:35:58Z Indexed on 2010/04/25 20:23 UTC
Read the original article Hit count: 201

Filed under:
|
|
|

Hi, I am in a bit of a dilemma about how best to handle the following situation. I have a long registration process on a site, where there are around 10 form sections to fill in. Some of these forms relate specifically to the user and their own personal data, while most of them relate to the user's pets - my current set up handles user specific forms in a User_Controller (e.g via methods like user/profile, user/household etc), and similarly the pet related forms are handled in a Pet_Controller (e.g pet/health). Whether or not all of these methods should be combined into a single Registration_Controller, I'm not sure - I'm open to any advice on that.

Anyway, my main issue is that I want to generate a progress bar which shows how far along in the registration process each user is. As the urls in each form section can potentially be mapping to different controllers, I'm trying to find a clean way to extract which stage a person is at in the overall process. I could just use the query string to pass a stage parameter with each request, e.g user/profile?stage=1. Another way to do it potentially is to use routing - e.g the urls for each section of the form could be set up to be registration/stage/1, registration/stage/2 - then i could just map these urls to the appropriate controller/method behind the scenes.

If this makes any sense at all, does anyone have any advice for me?

© Stack Overflow or respective owner

Related posts about mvc

Related posts about php