刀片视图不反映更改 [英] Blade view not reflecting changes

查看:65
本文介绍了刀片视图不反映更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows环境中开发Laravel(5.2.29)项目,并在Chrome浏览器上对其进行测试.

I am developing a Laravel(5.2.29) project in Windows environment and testing it on Chrome browser.

我已经使用原子文本编辑器对Blade文件进行了一些更改,然后刷新了页面,并注意到它突然停止反映所做的更改(正在加载旧的Blade文件).

I have made some changes on a Blade file using atom text editor and then refreshed my page and noticed that suddenly it has stopped reflecting the changes (it's loading the old Blade file).

我尝试了以下操作:

  • 重新启动浏览器
  • 清除浏览器缓存
  • 运行php artisan cache:clear
  • 运行composer dumpautoload
  • 删除Blade文件(并出现未找到视图错误).然后用相同的名称创建一个没有内容的新Blade文件,并刷新页面.
  • Restarted the browser
  • Clearing browser cache
  • Running php artisan cache:clear
  • Running composer dumpautoload
  • Deleting the Blade file (and got a view not found error). Then created a new Blade file with the same name, with no content and refreshed the page.

无论如何,浏览器上显示的代码始终是相同(旧)版本,而不是Blade文件的内容.

No matter what, the code displayed on the browser is always the same (old) version and not the content of the Blade file.

我该如何解决这个问题?

How can I solve this issue?

推荐答案

为避免每次重新加载时都会解析Blade文件,Laravel在处理Blade之后会缓存视图.我遇到过某些情况,其中源(查看文件)已更新,但缓存文件未重新加载".在这种情况下,您要做的就是删除缓存的视图并重新加载页面.

In order to avoid the parsing of Blade files on each reload, Laravel caches the views after Blade is processed. I've experienced some situations where the source (view file) is updated but the cache file is not "reloaded". In these cases, all you need to do is to delete the cached views and reload the page.

缓存的视图文件存储在storage/framework/views中.

The cached view files are stored in storage/framework/views.

这篇关于刀片视图不反映更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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