I'd like to use a checkmark as the text for a button. The entity I want is ✓ but when I put that in as the text for the button using the Form Helper, it always converts the leading ampersand into & so that the text shows but not the entity.
Here's how I'm creating the button:
echo $this->Form->button(
'✓',
array(
'type' => 'submit',
'id' => $checklistItem['ChecklistItem']['id'],
'escape' => 'false'
)
);
and the generated HTML looks like this:
<button type="submit" id="1">&#x2713;</button>
which obviously doesn't render the entity.
I've tried it by setting 'escape' => 'true' but that has not effect at all.
Any ideas?
You do not need to escape it false, it is by default escaped to false.
echo $this->Form->button('✓',
array(
'type' => 'submit',
'id' => $checklistItem['ChecklistItem']['id']
)
);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With