在Symfony2上的prod中使用assetic时,找不到Twitter Bootstrap glyphicons字体

 强压谷攻 发布于 2022-12-21 10:57

我已经阅读了很多关于这个的帖子,但是无法让这个用于我的项目.

所以基本上我有一个包含twitter bootstrap(v3)的Symfony2项目.在开发模式下,每件事都运行正常但是当我在prod模式下尝试它时,我得到错误,说无法找到twitter引导字体:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/Symfony/css/fonts/glyphicons-halflings-regular.woff   
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/Symfony/css/fonts/glyphicons-halflings-regular.ttf  
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/Symfony/css/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular

这是正常的原因我在Symfony中没有css /文件夹/

以下是项目的结构:

app/
src/
vendor/
web/
   css/
      compiled/
   fonts/
   js/

树枝文件:

{% block stylesheets %}
    {% stylesheets output="css/compiled/main.css" filter='cssrewrite'
        'css/bootstrap.min.css'
        'css/general.css'
        'css/navigation.css'
    %}
        
    {% endstylesheets %}
{% endblock %}

我用了:

php app/console assetic:dump --env=prod

我已经检查了bootstrap.min.css(在web/css/compiled中)文件(prod和dev),它们都有相同的字体路径.像(../../../fonts/fontName.ext)这样的东西.

如果我们查看路径它不应该在开发模式或prod模式下工作,因为路径将字体/文件放在web目录之外.然而,它在开发模式下工作.

有关如何解决此问题的任何想法?

我会很高兴.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有