سؤال

How can I make sure that, that second form elements go to the database cause when I check there the is no data but its been inputted by the user, if both forms are called from one controller

$form = new Form_Form1(); 
$this->view->form = $form;

$form2 = new Form_Form2();  
$this->view->form2 = $form2;


if ($this->getRequest()->isPost()) {
    $formData = $this->getRequest()->getPost();
    if ($form->isValid($formData)) {     
هل كانت مفيدة؟

المحلول

Try this:

if ($form->isValid($formData) && $form2->isValid($formData)) {...
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top