schranz-templating / mezzio-plates-integration
通过 plates 模板引擎将模板渲染器集成到 Mezzio。
0.1.0
2022-11-06 15:29 UTC
Requires
- php: ^7.4 || ^8.0
- mezzio/mezzio-platesrenderer: ^2.6
- psr/container: ^1.0 || ^2.0
- schranz-templating/plates-adapter: ^0.1
README
将模板适配器 Plates Adapter 集成到 Mezzio 框架中。
是 Schranz Templating 项目 的一部分。
安装
通过 Composer 安装此包
composer require schranz-templating/mezzio-plates-integration
如果框架尚未自动添加,请在您的 config/config.php
中注册 ConfigProvider 类
// ... $aggregator = new ConfigAggregator([ // ... \Mezzio\Plates\ConfigProvider::class, \Schranz\Templating\Integration\Mezzio\Plates\ConfigProvider::class, ]);
配置
Plates 集成当前没有配置,因为 Plates 由 Mezzio 内置支持,可以通过 Mezzio Plates 渲染器 进行配置。
与其他 Mezzio 渲染器一起使用
要与其他 Mezzio 渲染器集成一起使用,您需要配置文件的扩展名
// src/App/src/ConfigProvider.php class ConfigProvider { public function __invoke(): array { return [ // ... 'plates' => [ 'extension' => 'php', ], ]; } }