Jump to content

Advice on persisting DataObject


wincen

Recommended Posts

I'm writting my own php app using a front controller and MVC.  For something simple like site registration i have 1 registration model, view, and controller.  i want the registration to be done in 3 steps.  doing that is easy enough, but i'm wondering what is the best way to store the data the user enters in step 1 and carry it over to step 2?

 

currently the front controller creates a new registration controller on each time the user goes to the next step.  the registration controller creates a new model.  the old model's information is then lost.

 

how do experienced php developers deal with this?  do you store all user registration information in session variables to the end?  do you actually make database updates after each step?  is there another solution that i am compeltely missing? 

Link to comment
Share on other sites

[currently the front controller creates a new registration controller on each time the user goes to the next step.  the registration controller creates a new model.  the old model's information is then lost.

 

The simplest method is to store each step in the $_SESSION array. Either that, or pass the data around in hidden forms.

Link to comment
Share on other sites

The simplest method is to store each step in the $_SESSION array. Either that, or pass the data around in hidden forms.

 

so in each step i would have a session variable like $_SESSION['name'], $_SESSION['email'], etc etc?  it is straight forward, but it seems like it could get huge depending on what's required during registration.  when you say store each step in a $_SESSION array does that mean you can put the entire dataObject into a session variable?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.