schranz-templating/mezzio-handlebars-integration

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

0.1.0 2022-11-06 17:02 UTC

This package is auto-updated.

Last update: 2024-08-29 06:07:36 UTC


README

Handlebars 适配器 集成到 Mezzio 框架中。

Schranz 模板项目 的一部分。

安装

通过 Composer 安装此包

composer require schranz-templating/mezzio-handlebars-integration

如果框架尚未自动添加,请在您的 config/config.php 中注册 ConfigProvider 类

// ...

$aggregator = new ConfigAggregator([
    // ...
    \Schranz\Templating\Integration\Mezzio\Handlebars\ConfigProvider::class,
]);

配置

以下配置可用

// src/App/src/ConfigProvider.php

class ConfigProvider
{
    public function __invoke(): array
    {
        return [
            // ...
            'handlebars' => [
                'path' => 'src/App/templates',
                'cache_dir' => 'data/cache/handlebars',
            ],
        ];
    }
}