are you looking for $this->_forward('critere'); after your submit action
has completed?
-Bart
magrytos1 schreef:
Hi.
I have action add and a form for this action. After click on submit button i
want to add a data that I chose to my database and also I want to go to the
next page of my form 'critere'. When i put
setAction('critere');
in my form add form, after pushing submit button it goes to form critere,
but it doesn't add any data to my db. If I comment setAction() function, it
adds data, but it stays in add form.
Is it possible to put an array as an arguments for setAction()? If not, how
can I do 2 actions by pushin one button.
public function addAction()
{
$this->view->title = "Add Request";
$this->view->headTitle($this->view->title, 'PREPEND');
$form = new Form_Add();
//$this->view->form = $form;
if ($this->getRequest()->isPost()) {
$formData = $this->_request->getPost();
if ($form->isValid($formData)) {
$reqName = $form->getValue('requestName');
$type = $form->getValue('type');
$request = $form->getValue('request');
$requests = new Model_DbTable_Requests();
$requests->addRequest($reqName, $type, $request);
}
}
$this->view->form = $form;
}
thx