[英]Twig does not update changes in symfony
I am working with Symfony 2.8 in developer mode and Windows 10. When I update template Twig, always I have to clear cache to update render.我在开发人员模式下使用 Symfony 2.8 和 Windows 10。当我更新模板 Twig 时,我总是必须清除缓存以更新渲染。 I looked permissions for folders cache and logs and I have the necessary permissions.
我查看了文件夹缓存和日志的权限,并且拥有必要的权限。
Any help?有什么帮助吗?
Go to app config file (by defualt will be located in ../app/config/config.yml
from your root directory). 转到app配置文件(defualt将位于根目录的
../app/config/config.yml
)。 Scroll to the twig configuration settings (under twig:) and change the cache value (which should be pointing to the cache directory) to false like so: 滚动到twig配置设置(在twig :)下并将缓存值(应该指向缓存目录)更改为false,如下所示:
twig:
cache: false
If you do not see any cache configuration entry, simply add the line above. 如果您没有看到任何缓存配置条目,只需添加上面的行。
Or you can disable the twig cache on web/app_dev.php
only for avoid any problem when you're going to push your code in prod environnement. 或者,您可以在
web/app_dev.php
上禁用web/app_dev.php
缓存,以避免在prod环境中推送代码时出现任何问题。
You should try to execute the command below in terminal, in your symfony project directory.您应该尝试在终端中的 symfony 项目目录中执行以下命令。
php bin/console cache:clear
Symfony documentation about that: https://symfony.com/doc/current/deployment.html Symfony 有关的文档: https://symfony.com/doc/current/deployment.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.