How to combine two Zend_Forms into one Zend_Form?

Here's how I ended up doing it...I didn't want to namespace each form, I just wanted all the elements in the form so I decided to just add all the elements individually instead of using subForms.

Here's how I ended up doing it...I didn't want to namespace each form, I just wanted all the elements in the form so I decided to just add all the elements individually instead of using subForms. SetMethod('post'); $form1 = new Form_ContactPrimaryInformationForm(); $this->addElements($form1->getElements()); $form2 = new Form_ContactAdditionalInformationForm(); $this->addElements($form2->getElements()); } }.

1 This is how I do it as well. – Adrian Schneider Nov 15 '10 at 18:39.

You can use subforms. The only difference between Zend_Form and Zend_Form_SubForm are the decorators: $form1 = new Zend_Form(); // ... add elements to $form1 $form2 = new Zend_Form(); // ... add elements to $form2 /* Tricky part: * Have a look at Zend_Form_SubForm and see what decorators it uses. */ $form1->setDecorators(array(/* the decorators you've seen */)); $form2->setDecorators(array(/* ... */)); $combinedForm = new Zend_Form(); $combinedForm->addSubForm('form_1', $form1); $combinedForm->addSubForm('form_2', $form2); Then in the controller you assign the form to the view: $this->view->form = $combinedForm; And you can acces the two subforms in the view by name: // In the view echo $this->form->form_1; echo $this->form->form_2.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions