-- Simon Corless <[email protected]> wrote (on Monday, 15 December 2008, 11:20 AM -0800): > Hi, I was reading with interest a post by Matthew about storing Zend Forms in > the model. I am now implementing this method after storing the form and > model separately and utilising the form for validation. > > A simple question (I hope!) how do I merge a couple of forms, for instance I > have a supply form and a stock form. The supply form takes a supplier, part > no etc. The stock form takes a stock part no, title, description etc. > > When adding stock I would like to combine the two forms so the stock form in > turn asks for the supply details. When editing however you will edit the > stock record and supply records individually. How can I retrieve the form > from with in a form and merge the elements? Is there a Zend way or (as I am > already sub classing Zend_Form) shall I implement my own method? > > It's all working if I copy and paste the form elements from the supply form > into the stock form, but obviously I would like to make it write once...
Two words: sub forms. addSubForm() takes *either* a Zend_Form or Zend_Form_SubForm. :) instance.. -- Matthew Weier O'Phinney Software Architect | [email protected] Zend Framework | http://framework.zend.com/
