laravel 如何在 Microframework Lumen 中安装刀片模板?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36614128/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 13:36:25 来源:igfitidea点击:
How installing blade template in Microframework Lumen?
提问by Alex Quintero
I have this version: Lumen (5.2.6) (Laravel Components 5.2.*)
我有这个版本: Lumen (5.2.6) (Laravel Components 5.2.*)
回答by krisanalfa
It's installed by default.
它是默认安装的。
$app->get('/', function () use ($app) {
return $app->make('view')->make('welcome');
});
Make a file /resources/views/welcome.blade.php
to see it works.
制作一个文件/resources/views/welcome.blade.php
以查看它的工作原理。
UPDATE
更新
In Lumen 5.5, you can do this:
在 Lumen 5.5 中,你可以这样做:
$router->get('/', function () use ($router) {
return $router->app->make('view')->make('welcome');
});