schranz-templating / symfony-mustache-integration
通过Mustache模板引擎将模板渲染器集成到symfony中。
0.1.0
2022-09-17 15:53 UTC
Requires
- php: ^7.0 || ^8.0
- mustache/mustache: ^2.0
- schranz-templating/mustache-adapter: ^0.1
- symfony/config: ^4.4 || ^5.4 || ^6.0
- symfony/dependency-injection: ^4.4 || ^5.4 || ^6.0
- symfony/http-kernel: ^4.4 || ^5.4 || ^6.0
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代码。编译是一个耗时的过程,因此结果被缓存在此配置选项指定的目录中。