Laravel 4 - Glifos de Bootstrap
-
20-12-2019 - |
Pregunta
Alguien sabe como puedo hacer para poner un Bootstrap glyphicon
en mi
{{ link_to_route('post.create', 'New' ) }}
Me gustaría mostrar un glifo justo antes de "Nuevo" y no sé cómo hacerlo.
Solución
Prueba esto.
<a href="{{ route('post.create') }}">
<i class="glyphicon glyphicon-plus"></i>
<span>New</span>
</a>
Otros consejos
Con un ayudante como este:
function icon_link_to_route($icon, $route, $title = null, $parameters = array(), $attributes = array())
{
$url = route($route, $parameters);
$title = (is_null($title)) ? $url : e($title);
$attributes = HTML::attributes($attributes);
$title = '<span class="glyphicon glyphicon-'.e($icon).'"></span>' . $title;
return '<a href="'.$url.'"'.$attributes.'>'.$title.'</a>';
}
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow