I can add an element to a form like this:
$form->addElement($element);
However, that will put the element at the end of the form, I would like to prepend an element (put it at the beginning of the form).
Why? The form has dynamically generated fields (number of text fields and their labels are generated based on parameters from request) so the form class looks like this:
class Form1 extends Zend_Form
{
public function init()
{
$this->setMethod('post');
$submit = new Zend_Form_Element_Submit('submit1', array(
'label' => 'Submit',
'class' => 'input-submit'
));
$this->addElements(array(
$submit
));
}
}
There is only the submit button because I don't know how many text fields and with what labels there will be yet.