This is a pretty basic thing but I can't figure out how to solve this "properly" with Zend Framework:
Scenario:
- Page displays form 1,
- Page display form 2
This is a pretty basic thing but I can't figure out how to solve this "properly" with Zend Framework:
Scenario:
- Page displays form 1,
- Page displays form 2
class FooController extends Zend_Controller_Action { ... public function form1Action(){ if ($this->getRequest()->isPost()) { // save data from form1 in database $this->_forward('form2'); } // display form1 } public function form2Action(){ if ($this->getRequest()->isPost()) { // save data from form2 in database $this->_forward('somewherelese'); } // display form2 } }
When the user posts form1, first the if-condition in form1Action is executed (which is what I want), but also the if-condition in form2Action.
What would be toe proper way to "unset $this->getRequest()->isPost()"?
Note: the forms are build "by hand" (not using Zend Form)
isValid()
at some point? This should stop you from processing the data in form2 when form1 is POSTed, unless of course they are exactly the same. Or use Zend's built in Multi-Page Forms documented here framework.zend.com/manual/en/zend.form.advanced.html – Jake N