简体   繁体   English

Symfony PHP应用程序未在浏览器上显示CSS和JS

[英]Symfony PHP Application not showing CSS and JS on browser

My PHP application is not showing css and js on the browser. 我的PHP应用程序未在浏览器上显示css和js。 also it is not using ascetics. 也没有使用禁欲主义者。 how can i use assets on my application? 如何在应用程序中使用资产? Any help would be appreciated.Since apart from the official site not much content available on the web. 任何帮助将不胜感激。由于除了官方网站,网络上没有太多可用的内容。

You must dump your js and css files in Resources/public folder of your bundle. 您必须将js和css文件转储到包的Res​​ources / public文件夹中。

After, see this page to know how to integrate your files in twig template : http://symfony.com/doc/2.3/cookbook/assetic/asset_management.html 之后,请参阅此页面以了解如何将文件集成到树枝模板中: http : //symfony.com/doc/2.3/cookbook/assetic/asset_management.html

and finaly lauch this commands in your console : 最后在控制台中执行以下命令:

php app/console assets:install web/
php app console assetic:dump

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

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