schranz-templating / spiral-smarty-integration
通过smarty模板引擎将模板渲染器集成到spiral。
0.1.0
2022-11-14 21:24 UTC
Requires
- php: ^7.2 || ^8.0
- schranz-templating/smarty-adapter: ^0.1
- spiral/boot: ^3.0
- spiral/config: ^3.0
- spiral/core: ^3.0
README
将模板适配器Smarty Adapter集成到Spiral框架中。
是Schranz Templating项目的一部分。
安装
通过Composer安装此包
composer require schranz-templating/spiral-smarty-integration
如果框架没有自动添加,请在您的app/src/Application/Kernel.php
中注册Bootloader类
class Kernel extends \Spiral\Framework\Kernel { protected const LOAD = [ // ... \Schranz\Templating\Integration\Spiral\Smarty\Bootloader\SmartyBootloader::class, ]; }
配置
集成提供了以下配置。
// app/config/schranz_templating_smarty.php declare(strict_types=1); return [ 'paths' => [ 'hello' => 'app/views', ], 'cache_dir' => 'runtime/cache/smarty/cache', 'compile_dir' => 'runtime/cache/smarty/compile', ];