doubinduo3364 2017-02-07 23:54
浏览 27
已采纳

Laravel - php工匠的观点是什么:清楚吗?

I run a command php artisan view:clear, as I followed a tutorial on custom 404 pages in Laravel, and as explained, the command Clears all compiled view files, further on I looked it up in laravel docs and it said that it removes the cache from view files. The reason why im asking this is because

  • im not sure if this effects my view files
  • Will they stay the same?
  • Did i remove something important running this command?
  • What are these cache files for?
  • Will this effect my future work?
  • 写回答

1条回答 默认 最新

  • dskm94301 2017-02-08 00:01
    关注

    This command basically just clears out all cached views.

    Rather than loading your view every time, a cached copy can be stored in your storage folder. View caching is done because blade compiling each time is a waste of time, as blade obviously turns the template in to a proper PHP file.

    By running php artisan view:clear you simply clear out all the cached views, and so next time the blade view is loaded it will be compiled again rather than pulling it from the cache.

    im not sure if this effects my view files

    This does not effect the views themselves, it simply clears the cached copies.

    Will they stay the same?

    Your views themselves will stay the same, yes.

    Did i remove something important running this command?

    Only the cached copies of your views. These will simply be compiled again when the page is loaded.

    What are these cache files for?

    To prevent blade having to compile every time it is called, it can be done just once to prevent wasting this time.

    Will this effect my future work?

    Not at all.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 C#和C++混合编程,使用CLR托管,报错System.Runtime.InteropServices.SEHException
  • ¥30 .NET使用sqlite发布后报错
  • ¥15 微信小程序获取华为云影子设备失败,显示403报错
  • ¥15 Unity在WebGL平台导出Word报错问题
  • ¥15 ghpython这里总是报错而且rhino视图窗口内不显示怎么办
  • ¥15 布尔运算推导,请证明
  • ¥15 有没有人会打学生成绩管理系统呀
  • ¥15 在使用Fiddler和夜神模拟器抓包的时候一直出现443该怎么办啊QAQ搜了好几个笔记都没有解决
  • ¥15 3x7的二维数组A、B、C,A中的任意1个数组元素与B的任意1个数组元素、同时又与C的任意1个数组元素比较,把不同位置出现相同数的比较称为无意义,反之称为有意义,把有意义的比较打印输出。
  • ¥20 预测模型怎么处理原始数据(随机森林)