When I create a submit button in a ZF2 form like this:
$this->add(array(
'name' => 'save_closebutton',
'attributes' => array(
'type' => 'submit',
'value' => 'Save & Move On »',
'id' => 'save_closebutton',
'class' => 'btn btn-default'
),
));
and then put a formSubmit
element in the view like this:
echo $this->formSubmit($form->get('save_closebutton'));
ZF2 renders the text in the button as Save & Move On »
without rendering the character that the code represents.
I'm pretty sure that the problem is in the formSubmit
helper, because inspecting the element shows that the helper creates this:
<input id="save_closebutton" class="btn btn-default" type="submit" value="Save & Move On »" name="save_closebutton">
but if I simply echo the same string in the view,
echo '<input id="save_closebutton" class="btn btn-default" type="submit" value="Save & Move On »" name="save_closebutton">';
the button is rendered correctly.
How do I get formSubmit
to pass the character and not the code?