简体   繁体   中英

symfony 2.3 app.php seems not using the same twig as app_dev.php

I'm facing a strange problem with symfony 2.3

If I load pages using app_dev.php I can see my custom twig, but if I use app.php it seems to use an empty twig

please take a look at

http://www.waltervalvoenterprise.com/app_dev.php/login

and

http://www.waltervalvoenterprise.com/app.php/login

As you can see in source code, with app.php it doesn't load bootstrap etc so I think that it uses another twig...

Have you ever seen something like this? do you know how to solve this issue?

Perhaps try this commands and see if something changes.

php app/console cache:clear --env=prod --no-debug
php app/console assets:install --env=prod --no-debug
php app/console assetic:dump --env=prod --no-debug
php app/console cache:warmup --env=prod --no-debug

Because you have a login area I guess you configured your security.yml ? If so don't secure your assets behind a firewall. Otherwise they don't load. Could be that the dev assets are cached so you haven't noticed it yet. But that's only a suggestion...

In your firewalls section try the following:

firewalls:
    dev:
        pattern:    ^/(_profiler|_wdt|images|css|js)
        security:   false

Nothing with Twig here. You are using assets and in production environment you need to dump it first. Read more about dumping assetic files .

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

Check your page with google chrome console and you will see the errors

GET http://www.waltervalvoenterprise.com/js/5a7d0d0.js 404 (Not Found) login:41
GET http://www.waltervalvoenterprise.com/css/4e1390a.css 404 (Not Found) login:8

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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