Thanks Brian,
Unfortunately, that approach didn't work for me with the security
component...
I tried another approach which also works, but not once I add in the
security component:
function register()
{
if (!empty($this->data)) {
$this->User->create();
$this->User->set($this->data);
if($this->User->validates()) {
$this->setAction('confirm');
}
}
}
function confirm() {
if ($this->data['User']['ok'] == 'ok2') {
$this->setAction('confirm2');
}
else {
$this->set('newData', $this->data);
// show page with hidden form fields with this
data
}
}
function confirm2() {
// code to save
}
Now, I'm thinking it's perhaps because I'm modifying the 'ok' field,
but shouldn't a new hash be created for the 2nd page?
Thanks.
On Jun 8, 12:13 pm, brian <[email protected]> wrote:
> I suppose the simplest way would be to put some logic in the view to
> either display the form or the data to be confirmed. For the latter
> case, you'd have a second form with all hidden fields.
>
> Another option would be to use something like the WizardComponent (I
> think that's what it's called--check the Bakery).
>
> On Mon, Jun 8, 2009 at 4:48 AM, Marc<[email protected]> wrote:
>
> > Perhaps I'm being dense, but is there a simple way of showing the user
> > the data from the form that he/she just submitted and allow them to
> > then submit the data to be saved?
>
> > i.e.
>
> > (1) Enter your data -> (2) Is this ok? ok, now press submit to process
> > -> (3) Thanks, here's your receipt with the data you submitted.
>
> > I coded a multistep approach which works great, but it's a bit more
> > code than I would like and it fails with the security component
> > enabled.
>
> > This will be a credit card submission page, so I'd rather not save it
> > in the session using something like the wizard component.
>
> > Thanks,
> > Marc
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---