Hi guys,
I will try and outline exactly what I am doing.
I am building an order process which has 5 steps overall.
At the end of 5th step there is a need for saving data into a model.
After each step of the order process I am writing data into a session
(I have utilised the session helper for this purpose).
I know that my session data is available at the last step of the order
process, as I am able to echo it in the view of the last step of the
order process.
I have also been able to make the whole process 'persistent' throughout
the ordering steps, so that if the user wants to go back they do not
lose their data and are able to edit it before submitting an order.
The problem:
------------------
There are two problems I am having here.
First problem is what kind of code to use in order to validate data
after each step of the order process. If the validation goes into my
order.php model then surely it will execute after each submit()? How do
I let the script know when to validate which set of variables?
I also have the issue of not being able to pass the session variables
into the model using save() at the end of 5th step (final step). I get
no error messages, but nothing goes into the database either. With
regards to this I am trying something like:
$this->Order->save($this->Session->read('var_name'),
$this->Session->read('var_name2'),
$this->Session->read('var_name3'),
$this->Session->read('var_name4'), .... etc.
There is only one model I am concerned with saving to (i.e. the order
table in the database) for this process. It is not associated with any
other models.
So I am basically confused as to what is the (right) way to go about
carrying out this overall task. My playing around with the validates()
in the order.php didn't yield results, probably cause I am using it in
the wrong way.
If anyone can help I would be very thankful.
Thanks,
Jason
www.flexewebs.com
PS: I am getting a general gist that CakePHP is not really designed for
these kind of wizard-related problems?
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---