Zend Framework Zend_Form Decorators: <span> Inside Button Element?
- by leek
I have a button element that I've created like so:
$submit = new Zend_Form_Element_Button('submit');
$submit->setLabel('My Button');
$submit->setDecorators(array(
'ViewHelper',
array('HtmlTag', array('tag' => 'li'))
));
$submit->setAttrib('type', 'submit');
This generates the following HTML:
<li>
<label for="submit" class="optional">My Button</label>
<button name="submit" id="submit" type="submit">My Button</button>
</li>
I would like to wrap the inside of the button with a <span, like this:
<button...><span>My Button</span></button>
What is the best way to do this using Zend_Form?