Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 在我自己的包中重新使用SonataAdminBundle_Css_Symfony_Fonts_Sonata Admin_Assetic - Fatal编程技术网

Css 在我自己的包中重新使用SonataAdminBundle

Css 在我自己的包中重新使用SonataAdminBundle,css,symfony,fonts,sonata-admin,assetic,Css,Symfony,Fonts,Sonata Admin,Assetic,我刚刚安装了SonataAdminBundle,我发现SonataAdminBundle已经在公共文件夹中安装了fontawesome和另一个css/js资产,我的问题是如何在我自己的捆绑包中重用这些js/css资产?这是我的密码: {% block stylesheets %} {% stylesheets '@SonataAdminBundle/Resources/public/vendor/bootstrap/dist/css/boo

我刚刚安装了SonataAdminBundle,我发现SonataAdminBundle已经在公共文件夹中安装了fontawesome和另一个css/js资产,我的问题是如何在我自己的捆绑包中重用这些js/css资产?这是我的密码:

{% block stylesheets %}
            {% stylesheets
                '@SonataAdminBundle/Resources/public/vendor/bootstrap/dist/css/bootstrap.min.css'
                '@SonataAdminBundle/Resources/public/vendor/bootstrap/dist/css/bootstrap-theme.min.css'
                '@ApplicationSonataUserBundle/Resources/public/css/signin.css'
                '@SonataAdminBundle/Resources/public/vendor/AdminLTE/css/font-awesome.min.css'  
                filter='cssrewrite' 
                filter='yui_css'
            %}
                 <link rel="stylesheet" type="text/css" href="{{ asset_url }}">
            {% endstylesheets %}

        {% endblock %}  

但不幸的是,所有字体都是404状态?这是否意味着我们不能重复使用其他供应商捆绑包中的所有js/css?

我刚刚找到了答案,这里是: 跑

它将在web/文件夹中创建所有捆绑包资产,然后我将代码更改为:

{% block stylesheets %}
            {% stylesheets
                'bundles/sonataadmin/vendor/bootstrap/dist/css/bootstrap.min.css'
                'bundles/sonataadmin/vendor/bootstrap/dist/css/bootstrap-theme.min.css'
                '@ApplicationSonataUserBundle/Resources/public/css/signin.css'
                'bundles/sonataadmin/vendor/AdminLTE/css/font-awesome.min.css'  
                filter='cssrewrite' 
                filter='yui_css'
            %}
                 <link rel="stylesheet" type="text/css" href="{{ asset_url }}">
            {% endstylesheets %} 
现在一切正常,所有的图标都显示出来了

{% block stylesheets %}
            {% stylesheets
                'bundles/sonataadmin/vendor/bootstrap/dist/css/bootstrap.min.css'
                'bundles/sonataadmin/vendor/bootstrap/dist/css/bootstrap-theme.min.css'
                '@ApplicationSonataUserBundle/Resources/public/css/signin.css'
                'bundles/sonataadmin/vendor/AdminLTE/css/font-awesome.min.css'  
                filter='cssrewrite' 
                filter='yui_css'
            %}
                 <link rel="stylesheet" type="text/css" href="{{ asset_url }}">
            {% endstylesheets %} 
./app/console assetic:dump