如何在 Symfony 2 中重新加载 Twig 缓存 [英] How reload Twig cache in Symfony 2

查看:39
本文介绍了如何在 Symfony 2 中重新加载 Twig 缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Symfony 2 框架在 PHP 中开发的应用程序.我更改了一个 HTML 文件,但在我刷新页面时没有反映更改.

  1. 我重新启动了服务器.运气不好.

  2. 我试图从 /protected/cache/ 页面本身删除 Twig 文件夹.这不是加载.

如何重新加载 Twig 缓存?

注意事项:

  • 我正在使用 tomcat 服务器进行部署.
  • 我没有在服务器上配置 Symfony 2 命令行.
  • 我是 PHP 新手.

解决方案

最简单的方法,输入命令:

rm -rf app/cache/*

重点是:app/cache/中的所有文件都可以自由删除,需要的时候重新生成.

如果你真的只想清除树枝缓存:

rm -rf app/cache//twig

根据您的要求,将 替换为 devprodtest.>

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.

  1. I restarted the server. No luck.

  2. I tried to remove the Twig folder from the /protected/cache/ page itself. This is not loading.

How can I reload the Twig cache?

Notes:

  • I am using tomcat server to deploy.
  • I don’t have the Symfony 2 command line configured on the server.
  • I am new to PHP.

解决方案

The most simple way, type the command :

rm -rf 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

Replace <environment> by dev, prod, or test according to your requirements.

这篇关于如何在 Symfony 2 中重新加载 Twig 缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆