Problem with addDisplayGroup in the Zend Form

Posted by ulduz114 on Stack Overflow See other posts from Stack Overflow or by ulduz114
Published on 2010-02-08T07:41:55Z Indexed on 2010/04/09 19:13 UTC
Read the original article Hit count: 758

Filed under:
|
|

Hi all,

I have a form same the following code:

public function init(){


  $id=$this->createElement('hidden','cf_id');
  $id->setDecorators($this->elementDecorators);
  $id->setOrder(1);
  $this->addElement($id);

  $firstName=$this->createElement('text','firstName');
  $firstName->setDecorators($this->elementDecorators);
  $firstName->setLabel('name :');
  $firstName->setOrder(2);
  $firstName->setAttrib('class','textbox');
  $firstName->setAttrib('disabled',true);
  $this->addElement($firstName);

  $lastname=$this->createElement('text','family');
  $lastname->setLabel(' family:');
  $lastname->setDecorators($this->elementDecorators);
  $lastname->setOrder(3);
  $lastname->setAttrib('class','textbox');
  $lastname->setAttrib('disabled',true);
  $this->addElement($lastname);


  $this->addElement('button', 'cancel', array(
        'label' => 'Cancel Button',

  'class'=>'button',
        'decorators' => array(
            'ViewHelper',
        ),
    )); 

  $this->addElement('button', 'submit', array(
        'label' => 'Submit Button',

     'class'=>'button',
        'decorators' => array(
            'ViewHelper',
        ),
    )); 

  $this->addDisplayGroup(array('submit', 'cancel',), 'submitButtons', array(
        'order'=>4,
        'decorators' => array(
            'FormElements',
            array('HtmlTag', array('tag' => 'div', 'class' => 'element')),
        ),
    )); 
}

In this form there are some elements and two buttons. In display page, the buttons are shown above form before other elements.

How can I put these buttons at the bottom of all elemnts?

Thanks.

© Stack Overflow or respective owner

Related posts about zend-framework

Related posts about zend-form