wewo wrote:
> Dear all,
> 
> What would be your implementation recommendation (controller side) for
> setting up a tabbed multipage form (step1, step2, step {n}), where in
> every step different models and controllers are influenced and the
> different steps maybe influce other steps (available or not, a.s.o)?

My way (I'm using it in a subscription form which spreads across 4 pages):

SubscriptionController with four actions: step1(), step2(), step3(),
step4() (name them as you want).

Data is shared across the four steps within the Session data. Think
about the first step for a subscription, selecting the subscription
model (1 month, 12 months and so on). In the step1() method I save the
data to the session together with the information that step 1 was
completed (step 2 will redirect to step 1 if step 1 wasn't completed).

public function step1()
{
  (...)

  if ($this->data['Subscription']['subscription_type'] == 'yearly')
  {
    $this->Session->write('Subscription.step1_done', true);
    $this->Session->write('Subscription.subscription_type', '12months');
  }

  $this->redirect(array('controller' => 'subscription', 'action' =>
'step2'));
}

Same logic applies to step2(), step3() and step4(). Saving data to
database is done in step4 when all required steps are done.

Marcus


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

Reply via email to