schranz-templating / mezzio-smarty-integration
通过 Smarty 模板引擎将模板渲染器集成到 Mezzio。
0.1.0
2022-11-07 19:58 UTC
Requires
- php: ^7.0 || ^8.0
- psr/container: ^1.0 || ^2.0
- schranz-templating/smarty-adapter: ^0.1
README
将模板适配器 Smarty Adapter 集成到 Mezzio 框架中。
是 Schranz 模板项目 的一部分。
安装
通过 Composer 安装此包
composer require schranz-templating/mezzio-smarty-integration
在您的 config/config.php
中注册 ConfigProvider 类,如果框架尚未自动添加
// ... $aggregator = new ConfigAggregator([ // ... \Schranz\Templating\Integration\Mezzio\Smarty\ConfigProvider::class, ]);
配置
以下配置可用
// src/App/src/ConfigProvider.php class ConfigProvider { public function __invoke(): array { return [ // ... 'smarty' => [ 'paths' => ['src/App/templates'], 'cache_dir' => 'data/cache/smarty/cache', 'compile_dir' => 'data/cache/smarty/compile', ], ]; } }