Witam

W projekcie mam kilka formularzy zrobionych mniej więcej tak:

  1. class Moja_Forma extends Moj_Decorator
  2. {
  3. protected function _formA()
  4. {
  5. $form = new Moj_DecoratorSub();
  6. $element = new Zend_Form_Element...
  7.  
  8. $form->addElements($element1, $element2);
  9.  
  10. return $form;
  11. }
  12.  
  13. public function init()
  14. {
  15. $this->addSubForm('formA', $this->_formA());
  16. $this->addSubForm('formB', $this->_formB());
  17. }
  18.  
  19. }

Z powodu layoutu muszę wyświetlać formy w specyficzny sposób:

  1. <?php echo $this->form->getSubForm('formA'); ?>
  2. ...
  3. ...
  4. ....
  5. <?php echo $this->form->getSubForm('formB'); ?>


Przy wyświetlaniu jednak ignoruje moje dekoratory - wyświetla <dl><dt>.
Widzicie może gdzie popełniłem błąd ?

Przy normalnym pokazywaniu formularzy
  1. echo $this->form; ?>

Wszystko jest ok (dla formularzy bez SubForm)

Dekoratory:
  1. class Moj_Decorator extends ZendX_JQuery_Form
  2. {
  3. /**
  4.   * Load the default decorators
  5.   *
  6.   * @return void
  7.   */
  8. public function loadDefaultDecorators()
  9. {
  10. $this->clearDecorators();
  11. $this->addDecorator('FormElements')
  12. ->addDecorator('HtmlTag', array('tag' => '<ul>'))
  13. ->addDecorator('Form');
  14.  
  15. $this->setElementDecorators(array(
  16. array('UiWidgetElement'),
  17. array('Errors'),
  18. array('Description'),
  19. array('Label', array('separator'=>' ')),
  20. array('HtmlTag', array('tag' => 'li', 'class'=>'element-group')),
  21. ));
  22. }
  23. }
  24.  
  25. class Moj_DecoratorSub extends Moj_Decorator
  26. {
  27. /**
  28.   * Whether or not form elements are members of an array
  29.   * @var bool
  30.   */
  31. protected $_isArray = true;
  32.  
  33. /**
  34.   * Load the default decorators
  35.   *
  36.   * @return void
  37.   */
  38. public function loadDefaultDecorators()
  39. {
  40. $this->clearDecorators();
  41. $this->addDecorator('FormElements')
  42. ->addDecorator('HtmlTag', array('tag' => '<ul>'))
  43. ->addDecorator('Fieldset');
  44.  
  45. $this->setElementDecorators(array(
  46. array('UiWidgetElement'),
  47. array('Errors'),
  48. array('FormElements'),
  49. array('Description'),
  50. array('Label', array('separator'=>' ')),
  51. array('HtmlTag', array('tag' => 'li', 'class'=>'element-group')),
  52. ));
  53. }
  54. }