您想在Symfony2中使用Bootstrap。 但是,在我欠的租赁服务器中,不能使用较少的命令。 所以从http://getbootstrap.com/开始,你已经下载了css,你已经下载了,字体等等。 但是,不会出现glyphicon。 是不是设置错误的方法?
MyBudle
+ Resources
+ Public
+ Css
+ Fonts
+ Js
page.html.twig
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{% block stylesheets %}
{% stylesheets '@LouteBundle/Resources/public/css/*' filter='cssrewrite' %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
{% endblock %}
{% block javascripts %}
{% javascripts '@LouteBundle/Resources/public/js/*' %}
<script type="text/javascript" src="{{ asset_url }}"></script>
{% endjavascripts %}
{% endblock %}
{% stylesheets
output='fonts/glyphicons-halflings-regular.eot'
'@LouteBundle/Resources/public/fonts/glyphicons-halflings-regular.eot'
%}
{% endstylesheets %}
{% stylesheets
output='fonts/glyphicons-halflings-regular.svg'
'@LouteBundle/Resources/public/fonts/glyphicons-halflings-regular.svg'
%}
{% endstylesheets %}
{% stylesheets
output='fonts/glyphicons-halflings-regular.ttf'
'@LouteBundle/Resources/public/fonts/glyphicons-halflings-regular.ttf'
%}
{% endstylesheets %}
{% stylesheets
output='fonts/glyphicons-halflings-regular.woff'
'@LouteBundle/Resources/public/fonts/glyphicons-halflings-regular.woff'
%}
{% endstylesheets %}
</head>
使用glyphicon
<body>
<nav class="navbar navbar-inverse" role="navigation" id="top">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">
<span class="glyphicon glyphicon-home"></span>
</a>