简体   繁体   English

从Symfony2中的开发(app_dev.php)到生产(app.php)

[英]From development (app_dev.php) to production (app.php) in Symfony2

I'm working in a Symfony2 project, under development enviroment app_dev.php all works fine but when I go to production app.php I get this error at Firebug console: 我正在开发一个Symfony2项目,在开发环境下app_dev.php一切正常,但是当我去生产app.php我在Firebug控制台上遇到这个错误:

"NetworkError: 404 Not Found - http://applicationtest.com/css/fmain.css " “NetworkError:404 Not Found - http://applicationtest.com/css/fmain.css

And of course CSS and JS isn't working, what I miss? 当然CSS和JS不起作用,我想念的是什么?

It seems that you have not dumped assetic resources: 您似乎没有倾倒assetic资源:

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

And then try again... 然后再试一次......

for example: 例如:

//routing.yml
test_root: 
    path: /css/fmain.css
    defaults:  { _controller: AcmeBlogBundle:Blog:index }
..

is valid. 已验证。 That means that the request of that root will call the indexAction of the Blog Controller in my exemple. 这意味着该根的请求将在我的例子中调用Blog Controller的indexAction。

thought, are you trying just to include some css file? 想,你是否只想包含一些css文件?

is so check the doc: http://symfony.com/fr/doc/current/book/templating.html#liens-vers-des-fichiers 是这样查看文档: http//symfony.com/fr/doc/current/book/templating.html#liens-vers-des-fichiers

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

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