I am working on a cakePHP project and I need to create a button using PHP that will delete an entry in a database, but I want to display the twitter bootstrap trashcan icon on said button.
The code to include the icon from twitter bootstrap is;
<i class="icon-trash"></i>
And the PHP code I need it to work in is;
<?php echo $this->Form->postLink(__('Delete'),
array(
'action' => 'delete',
$skill['Skill']['SkillID']),
array(
'class'=>'btn'),
null,
__('Are you sure you want to delete # %s?',
$skill['Skill']['SkillID']
));?>
Does anyone know how to implement the html in this PHP code so I can replace the text ‘Delete’ with the icon?
'escape' => falsemakes CakePHP display the HTML unescaped.It might (depending on the CSS) also work if you just add the
icon-trashclass to the link.