[英]Assetic doesn't work Symfony 3
I have a application with two different base twig files. 我有一个带有两个不同基本树枝文件的应用程序。 One is for the main application and the other is for the docs for the application.
一个用于主应用程序,另一个用于该应用程序的文档。
In both base files i use different css files. 在两个基本文件中,我使用不同的css文件。 In one base it works and in a other one it does not work.
在一个基础上它起作用,而在另一个基础上它不起作用。
This is the working base file 这是工作基础文件
{% stylesheets output='css/compiled/main.min.css'
'@CoreBundle/Resources/public/css/feedback.css'
'@CoreBundle/Resources/public/css/general.css'
'@CoreBundle/Resources/public/css/portal.css'
'@UserBundle/Resources/public/css/*.css'
%}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
and this is the base file that does not work 这是不起作用的基本文件
{% stylesheets output='css/compiled/knowledge.min.css'
'@CoreBundle/Resources/public/css/knowledgeCenter.css'
%}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
I have in mijn assetic.yml (which is included in my config.yml) 我在mijn assetic.yml中(包含在我的config.yml中)
assetic:
debug: "%kernel.debug%"
use_controller: '%kernel.debug%'
read_from: "%kernel.root_dir%/../web"
bundles: [ ]
#java: /usr/bin/java
filters:
scssphp:
formatter: 'Leafo\ScssPhp\Formatter\Compressed'
uglifyjs2:
bin: /usr/local/bin/uglifyjs
uglifycss:
bin: /usr/local/bin/uglifycss
cssrewrite: ~
#closure:
# jar: "%kernel.root_dir%/Resources/java/compiler.jar"
#yui_css:
# jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
The folder @CoreBundle/Resources/public/css looks the following 文件夹@ CoreBundle / Resources / public / css看起来如下
Note: the knowledgeCenter.css is compiled by phpstorm from scss Note: the .css file is not in the .scss file it is something that phpstorm shows 注意:KnowledgeCenter.css由phpstorm从scss编译而来。注意:.css文件不在.scss文件中,这是phpstorm显示的内容
My console looks like this when i update the assets 更新资产时,我的控制台看起来像这样
As you can see it does not include the css i made in the public/css folder 如您所见,它不包括我在public / css文件夹中制作的CSS
I have tried the following 我尝试了以下
Cleaned all the cache and installed assets again with php bin/console 再次使用php bin /控制台清理所有缓存并安装资产
(i tried these commands (我尝试了这些命令
bin/console cache:clear bin /控制台缓存:清除
bin/console cache:clear --env=prod bin /控制台缓存:clear --env = prod
bin/console assets:install web 箱/控制台资产:安装网站
bin/console assetic:dump bin /控制台资产:dump
bin/console assetic:dump --env=prod bin /控制台资产:dump --env = prod
) )
All the following things did not work 以下所有内容均无效
Thank you in advance ! 先感谢您 !
The documentation here says like this. 这里的文档是这样说的。 Maybe u forgot the filter options.
也许您忘记了过滤器选项。
{% stylesheets filter="scssphp" output="css/app.css"
"assets/scss/bootstrap.scss"
"assets/scss/font-awesome.scss"
"assets/css/*.css"
%}
<link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.