schranz-templating/mezzio-mustache-integration

通过Mustache模板引擎将模板渲染器集成到mezzio。

0.1.0 2022-11-06 17:02 UTC

This package is auto-updated.

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


README

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

Schranz模板项目的一部分。

安装

使用Composer安装此包

composer require schranz-templating/mezzio-mustache-integration

如果你的config/config.php中还没有自动添加,请注册ConfigProvider类

// ...

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

配置

以下配置可用

// src/App/src/ConfigProvider.php

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