简体   繁体   English

Heroku Symfony2应用程序有效,但没有CSS / JS / etc

[英]Heroku Symfony2 App Works but No CSS/JS/etc

I finally just got my Symfony2 app to work in Heroku except that it's not getting any CSS or JS. 我终于让我的Symfony2应用程序在Heroku中工作,除了没有任何CSS或JS。 Does anyone know what the problem might be? 有谁知道可能是什么问题?

Including <head> code from the base.twig.html 包括来自base.twig.html <head>代码

<head>

    <meta charset="UTF-8" />
    <title>{% block title %}Machine{% endblock %}</title>
    {% block stylesheets %}
        <link rel="stylesheet" type="text/css" href="{{ asset('bundles/bmatznerfoundation/css/foundation.min.css') }}">
        <link rel="stylesheet" type="text/css" href="{{ asset('bundles/project/css/main.css') }}">
        <link href='http://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
        <script type="text/javascript" src="{{ asset('bundles/project/js/jquery-1.11.2.min.js') }}"></script>
        <script type="text/javascript" src="{{ asset('bundles/project/js/script.js') }}"></script>
    {% endblock %}
    <link rel="icon" type="image/x-icon" href="{{ asset('bundles/project/favicon.ico') }}">

</head>

I noticed that it seems to be using Symfony2 favicon and such. 我注意到它似乎正在使用Symfony2图标等。 So it might be using the wrong directory somehow, or bundle, for the "web" view of things. 因此,对于事物的“ Web”视图,它可能以某种方式或目录使用了错误的目录。

it's 它的

Root >
    Web >
      bundles >
          bmatznerfoundation > ... 
          framework > (original symfony junk)
          project > (THE FILES I WANT)
      .htaccess
      app.php
      app_dev.php
      apple-touch-icon.png
      config.php
      favicon.ico (a Symfony icon)
      robots.txt

Haha, this is silly, in my .gitignore file, /web/bundles was there. 哈哈,这很愚蠢,在我的.gitignore文件中, /web/bundles在那儿。 I simply removed it, re-committed, then everything worked great! 我只是将其删除,重新提交,然后一切正常!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM