如何在微框架内腔中安装刀片模板


How installing blade template in Microframework Lumen?

我有这个版本:管腔(5.2.6)(Laravel组件5.2.*)

它是默认安装的。

$app->get('/', function () use ($app) {
    return $app->make('view')->make('welcome');
});

制作一个文件/resources/views/welcome.blade.php以查看其工作情况。


更新

在Lumen 5.5中,您可以这样做:

$router->get('/', function () use ($router) {
    return $router->app->make('view')->make('welcome');
});