CakePHP: How to Use HTML Objects in Button Titles with Form Helper
I would like to use a check mark as the text for a button. The entity I want is this ✓
, but when I put it as text for a button using the Form Helper, it always converts the leading ampersand to &
so that the text shows, but not the entity.
This is how I create 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 object.
I tried this by installing 'escape' => 'true'
but it had no effect at all.
Any ideas?
+3
source to share
2 answers