理由はわかりませんが、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');