Parse a string instead of a file for a Laravel Blade template

痞子三分冷 提交于 2019-12-10 20:59:18

问题


I need to cache a remote blade template generated by a CMS to keep an application's public interface up to date. Ideally I would be able to use file_get_contents and a cache to check for updates to this once a week. Is there any way to get Laravel to use the contents of a variable instead of a file as a blade template?


回答1:


I could not find a way to get laravel to parse a string as a blade template so I developed this work around that stores the remote template as a local file. RemoteViewFinder Gist



来源:https://stackoverflow.com/questions/28769358/parse-a-string-instead-of-a-file-for-a-laravel-blade-template

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!