Laravel 4 - Glyphicons Bootstrap
-
20-12-2019 - |
Domanda
qualcuno sò come posso fare per mettere un Bootstrap glyphicon
nel mio
{{ link_to_route('post.create', 'New' ) }}
Vorrei mostrare un gliphicon poco prima di "nuovo", e non so come farlo.
Soluzione
Prova questo.
<a href="{{ route('post.create') }}">
<i class="glyphicon glyphicon-plus"></i>
<span>New</span>
</a>
. Altri suggerimenti
Con un aiutante come questo:
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>';
}
. Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow