如何在Symfony 2中重新加载Twig缓存 [英] How reload Twig cache in Symfony 2
问题描述
我有一个使用Symfony 2框架在PHP中开发的应用程序.我已经更改了HTML文件,但是当刷新页面时所做的更改没有反映出来.
I have a application which is developed in PHP using the Symfony 2 framework. I have changed a HTML file, but the change is not reflecting when I refresh the page.
-
我重新启动了服务器.没有运气.
I restarted the server. No luck.
我试图从/protected/cache/
页面本身中删除Twig文件夹.这没有加载.
I tried to remove the Twig folder from the /protected/cache/
page itself. This is not loading.
如何重新加载Twig缓存?
How can I reload the Twig cache?
注意:
- 我正在使用tomcat服务器进行部署.
- 我没有在服务器上配置Symfony 2命令行.
- 我是PHP新手.
推荐答案
最简单的方法是键入命令:
The most simple way, type the command :
rm -rf app/cache/*
重点是:app/cache/
中的所有文件都可以自由删除,并在需要时重新生成.
The point is: all files in app/cache/
can be removed freely, they are regenerated when needed.
如果您真的只想清除树枝缓存:
If you really want to clear only twig cache :
rm -rf app/cache/<environment>/twig
根据您的要求用dev
,prod
或test
替换<environment>
.
Replace <environment>
by dev
, prod
, or test
according to your requirements.
这篇关于如何在Symfony 2中重新加载Twig缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!