Hi!
I have an action like that:
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->_forward('question');
}
}
}
1. Function addRequest adds the records to db. The problem is that after
pushing my submit button, it goes to 'question', but it adds nothing to db.
Why?
2. What is all about this _forward function. I mean after call it, I'm in
question view, but in my adress bar I still have public/index/add? I red ref
guide, but I couldn't understand it :/
3. Question about submit: having 2 sub buttons I want them to send me to a
different actions. I did something like this:
if($form->yes->isChecked()){
$form->setAction('critere');
}
else { $form->setAction('index'); }
but my if-condition is always false
Thx
--
View this message in context:
http://www.nabble.com/Zend-Form---_forward%28%29-and-submit-questions-tp24513058p24513058.html
Sent from the Zend Framework mailing list archive at Nabble.com.