我不明白为什么,但由于 Assetic,我的包的图像没有被正确调用。我尝试通过以下方式获得它:
background-image: url('../images/bg-header-1.jpg');
在我的 VisualImmersion/SiteBundle/Resources/public/css/home.css 中,我的图像在:VisualImmersion/SiteBundle/Resources/public/images/bg-header-1.jpg
我认为我在我的总体布局中对资产使用了很好的方法:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="follow">
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'/>
<title>{% block title %} Visual Immersion - Agence de communication {% endblock %}</title>
<meta name="description" content="Agence de communication | Développement web - Référencement SEO / Adwords - Développement mobile / tablettes - Brand design - Community Management - Evènementiel ">
<link rel="icon" type="image/png" href="{{ asset('css/images/favicon.png') }}"/>
{% stylesheets filter= 'cssrewrite'
'css/stylesheets/layout.css'
'css/stylesheets/style.css'
'css/stylesheets/font.css'
'css/stylesheets/responsive.css'
'css/stylesheets/personalized-responsive.css'
'@VisualImmersionSiteBundle/Resources/public/css/*'
%}
<link rel="stylesheet" type="text/css" href="{{ asset_url }}">
{% endstylesheets %}
{% block javascripts %}
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://twitterjs.googlecode.com/svn/trunk/src/twitter.min.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41814706-1', 'visual-immersion.com');
ga('send', 'pageview');
</script>
{% endblock %}
</head>
但是没有图...
预先感谢您的帮助
编辑:我的 dev_config.yml
imports:
- { resource: config.yml }
framework:
router:
resource: "%kernel.root_dir%/config/routing_dev.yml"
strict_requirements: true
profiler: { only_exceptions: false }
web_profiler:
toolbar: true
intercept_redirects: false
monolog:
handlers:
main:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
firephp:
type: firephp
level: info
chromephp:
type: chromephp
level: info
assetic:
use_controller: true
filters:
cssrewrite: ~
那是我的 6de3e66_part_6_home_1.css:
background-image: url('../../Resources/public/images/bg-header-1.jpg');