schranz-templating/spiral-handlebars-integration

通过 Handlebars 模板引擎将模板渲染器集成到 Spiral。

0.1.0 2022-11-14 21:24 UTC

This package is auto-updated.

Last update: 2024-08-29 05:56:27 UTC


README

将模板适配器 Handlebars Adapter 集成到 Spiral 框架中。

Schranz 模板项目 的一部分。

安装

使用 Composer 安装此包

composer require schranz-templating/spiral-handlebars-integration

在您的 app/src/Application/Kernel.php 中注册 Bootloader 类,如果框架尚未自动添加

class Kernel extends \Spiral\Framework\Kernel
{
    protected const LOAD = [
        // ...
        \Schranz\Templating\Integration\Spiral\Handlebars\Bootloader\HandlebarsBootloader::class,
    ];
}

配置

集成提供了以下配置。

// app/config/schranz_templating_handlebars.php

declare(strict_types=1);

return [
    'path' => 'app/views',
    'cache_dir' => 'runtime/cache/handlebars',
];