Hi fellow Phalconers,
I'm using the dispatcher to forward a user to the next form/view after first saving and validating the current form (see controller snippet below):
if ($form1->save())) {
return $this->dispatcher->forward(array(
'controller' => 'index',
'view' => 'form2'
));
}
However, this is triggering the isPost()
on form2, and therefore the form's validation.
if ($this->request->isPost()) {
// form processing, checking valid, save, etc.
}
Is there anyway to stop the forward from triggering isPost
? I did try:
if (($this->request->isPost()) && (!$this->dispatcher->wasForwarded())) {
// form processing, checking valid, save, etc.
}
But unfortunately this then stops 'form2' from being processed.