Laravel 4 - 引导Glyphicons
-
20-12-2019 - |
题
任何人都知道我如何在我的
中放置一个生成的Bootstrap glyphicon
{{ link_to_route('post.create', 'New' ) }}
我想在'new'之前展示一个glyphicon,我不知道如何做到这一点。
解决方案
试试这个。
<a href="{{ route('post.create') }}">
<i class="glyphicon glyphicon-plus"></i>
<span>New</span>
</a>
. 其他提示
与这样的帮助者:
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>';
}
. 不隶属于 StackOverflow