I'm trying to get the font awesome icon to show in my delete button in my laravel form.
Here is the delete button
{{ Form::submit('<i class="fa fa-pencil"></i> Delete', array('class' => 'btn btn-danger', 'role' => 'button')) }}
I'm trying to get the font awesome icon to show in my delete button in my laravel form.
Here is the delete button
{{ Form::submit('<i class="fa fa-pencil"></i> Delete', array('class' => 'btn btn-danger', 'role' => 'button')) }}
When you use Form::submit, the content is always escaped. You can use Form::button instead, which does not escape the content.
Your code can be tweaked to:
{{ Form::button('<i class="fa fa-pencil"></i> Delete', ['class' => 'btn btn-danger', 'role' => 'button', 'type' => 'submit']) }}
Also make sure to set type = submit while using Form::button.
{{Form::button(' Se connecter<i class="fa fa-key icon-on-right"></i>', array(
'type' => 'submit',
'class'=> 'pull-right btn btn-primary',
))}}
Check out my previous answer.
Basicly laravel allows to decode any html with {{HTML::decode(<insert Form button here>) }}
Unfortunately the form builder is always going to escape it's content. Furthermore, the submit input type only supports text content, not HTML. You need to use a button element to display HTML content.
<button class="btn btn-danger"><i class="fa fa-pencil"></i> Delete</button>