我有一个快速问题。
我第一次使用Symfony,遇到了包括CSS在内的问题。
在我的应用程序''Resources''views''master.html.twig中,我有:
<link rel='stylesheet' type='text/css' href='{{ asset('/css/huraga-green.css') }}'>
我不能让它工作,它实际上产生:
<link rel="stylesheet" type="text/css" href="/css/xy.css">
指向:
http://localhost/css/xy.css
问题是,我使用的是easyPHP,在这条路上我没有任何东西,我的Symfony项目的根在:
C: ''Program Files(x86)''EasyHP-DevServer-13.1VC9''data''localweb''projects''symfony''
正如我所说,我是Symfony的新手,所以任何帮助都将不胜感激:)
TNx太多了!
来自Symfony文档:http://symfony.com/doc/current/cookbook/assetic/asset_management.html#including-css样式表
包括CSS样式表
要引入CSS样式表,您可以使用上面解释的相同技术,除了使用样式表标签:
{% stylesheets 'bundles/app/css/*' filter='cssrewrite' %}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}