Passing An Array Between Two Diffrent Controllers

Hi once again,

need your help…

how can i pass an array between two diffrent controllers

Thanks

Option 1. Via GET string.

Option 2. Via POST body.

Option 3. Session

Option 4. Cookies

Option 5. DB

Probably you should elaborate what are you trying to achieve. Maybe your task can be solved some other way.

hi Orey,

i was also thinking on session way but thought maybe not so good.

My Task: A user select a Package and move to next Form and there he select other addition packages depending on what he has selected in previous and third Form there he Register his account.

So was thinking collect all data and write later in db using his user_id that he get when he is registered.

I see.

What you need is so-called "multi-page forms", or "form wizards".

See this post for example: http://www.yiiframework.com/forum/index.php/topic/7774-stateful-forms/

Multiple ways as ORey suggested. Normally speaking I would pass these arrays (possibly after serialize/json-encode) and other data directly via POST submission from one form to the other form. You may need to maintain all the related form data (in each step’s form as hidden inputs) so that you have them within POST, across all steps/forms if you are not saving data till the last step.