gpt4 book ai didi

themes - Symfony2 主题

转载 作者:行者123 更新时间:2023-12-02 09:49:04 25 4
gpt4 key购买 nike

我希望在我的 Symfony2 项目中提供基本的主题支持,因此我希望为每个主题提供单独的静态文件(css、js、img)。

我尝试添加

assetic:
read_from: %kernel.root_dir%/../web/themes/mytheme

但这没有效果,我的 {{ asset('css/style.css') }} 仍然引用 realtic %kernel.root_dir%/../web,而不是 %kernel.root_dir%/../网络/主题/mytheme。

有什么想法吗?

最佳答案

已通过配置修复:

assetic:
debug: %kernel.debug%
use_controller: false
read_from: %kernel.root_dir%/../web/bundles/mybundle/themes/%my_theme%
write_to: %kernel.root_dir%/../web
filters:
yui_css:
jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"
yui_js:
jar: "%kernel.root_dir%/Resources/java/yuicompressor.jar"

在布局中我有:

    {% stylesheets 'css/*' filter='?yui_css' %}
<link rel="stylesheet" type="text/css" media="all" href="{{ asset_url }}" />
{% endstylesheets %}

关于themes - Symfony2 主题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5831274/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com