schranz-templating/spiral-smarty-integration

通过smarty模板引擎将模板渲染器集成到spiral。

0.1.0 2022-11-14 21:24 UTC

This package is auto-updated.

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


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',
];