Symfony转储资产两次现在应用程序找不到CSS

时间:2017-10-06 07:00:41

标签: php css symfony

我是Symfony的新手,一个表格在我的网站上搞砸了,所以我决定备份web / css /编译中的所有CSS文件,我做了

php app/console assets:install --symlink web --env=prod
php app/console assetic:dump --env=prod

在其上创建了其他文件......

当我打开我的网站时,它没有加载新的CSS文件(例如:all.css),当我检查它时加载旧的(例如:all_all.css

我清除这些缓存

php app/console cache:clear --env=prod (and dev)

但它仍然没有加载正确的文件

如何让Symfony查找转储的新CSS文件?

这是base.html.twig的主要部分:

<head>
    <title>
        {%- block meta_title -%}
            {{ app.request.requestUri|slice(4)|replace({'/': " > ", '-': " ", '_': " "})|ucwords ~ " - " ~ cocorico_site_name }}
        {%- endblock -%}
    </title>
    <meta name="description" content="{%- block meta_description -%}{{ cocorico_short_description }}{%- endblock -%}">

    {%- block open_graph_data -%}{%- endblock -%}

    <meta charset="utf-8">
    <!-- set the viewport width and initial-scale on mobile devices -->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- include the Open and Raleway Sans google font -->
    <link href='//fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,700,600italic,700italic,800,800italic'
          rel='stylesheet' type='text/css'>
    <!-- include the Raleway google font -->
    <link href='//fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,600,700,800,900' rel='stylesheet'
          type='text/css'>

    <!-- include HTML5 IE enabling script and stylesheet for IE -->
    <!--[if lt IE 9]>
    <link type="text/css" media="all" rel="stylesheet" href="{{ asset('css/ie.css') }}">
    <script type="text/javascript" src="{{ asset('js/vendor/ie.js') }}"></script>
    <![endif]-->

    <link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">

    {% block stylesheets %}
        {% stylesheets
        'css/all.css'
        'css/all-override.css'
        'css/vendor/bootstrap-multiselect.css'
        'css/vendor/bootstrap-datetimepicker.css'

        filter='cssrewrite, ?minifycsscompressor' output='css/compiled/all.css' %}
        <link rel="stylesheet" href="{{ asset_url }}" type="text/css" media="all">
        {% endstylesheets %}
    {% endblock %}

    {# Safely using .ready() before including jQuery #}
    <script>
        (function (w, d, u) {
            w.readyQ = [];
            w.bindReadyQ = [];
            function p(x, y) {
                if (x == "ready") {
                    w.bindReadyQ.push(y);
                } else {
                    w.readyQ.push(x);
                }
            }
            var a = {ready: p, bind: p};
            w.$ = w.jQuery = function (f) {
                if (f === d || f === u) {
                    return a
                } else {
                    p(f)
                }
            }
        })(window, document);
    </script>

    {% include '@CocoricoCore/Frontend/Common/js/_google_analytics_js.html.twig' only %}

    {#Rich snippets used by search engines like google  #}
    {%- block markup_jsonld -%}
        {% include '@CocoricoSeo/Frontend/Common/_markup.jsonld.twig' ignore missing only %}
    {%- endblock -%}
</head>

谢谢

0 个答案:

没有答案