I have the following element being created in Zend Form:
// Add the submit button
$this->addElement('button', 'cancel', array(...)
));
Which creates a button element as expected. What if I want to create a button element with span tag nested inside like so:
<button ...>
<span>Cancel</span>
</button>
Any ideas?
The problem with the answers in the other question is that it renders the buttons translatable capability useless.
Here’s my solution. It’s practically a copy of both
Zend_Form_Element_ButtonandZend_View_Helper_FormButton, with added functionality.The form element:
The view helper:
Possible usage:
Improvements welcomed.