Pergunta

Alguém sabe como posso fazer para colocar um Bootstrap glyphicon no meu

{{ link_to_route('post.create', 'New' ) }}

Gostaria de mostrar um glifo antes de 'Novo' e não sei como fazer.

Foi útil?

Solução

Experimente isso.

<a href="{{ route('post.create') }}">
        <i class="glyphicon glyphicon-plus"></i>
        <span>New</span>
</a>

Outras dicas

Com um ajudante 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 em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top