schranz-templating/symfony-mustache-integration

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

0.1.0 2022-09-17 15:53 UTC

This package is auto-updated.

Last update: 2024-08-29 05:50:45 UTC


README

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

Schranz模板项目的一部分。

安装

使用Composer安装此包

composer require schranz-templating/symfony-mustache-integration

在您的config/bundles.php或Kernel文件中注册Bundle类

return [
    // ...
    Schranz\Templating\Integration\Symfony\Mustache\SchranzTemplatingMustacheBundle::class => ['all' => true],
];

配置

Mustache集成具有以下配置选项

schranz_templating_mustache:
    default_path: '%kernel.project_dir%/templates'
    cache: '%kernel.cache_dir%/mustache'

无需任何配置。

default_path

类型: 字符串 默认: '%kernel.project_dir%/templates'

这是Symfony默认查找应用程序Mustache模板的目录路径。

cache

类型: 字符串 默认: '%kernel.cache_dir%/mustache'

在将Mustache模板用于渲染内容之前,它们会被编译成常规PHP代码。编译是一个耗时的过程,因此结果被缓存在此配置选项指定的目录中。