arcadis-intelligence/gomphplate
最新稳定版本:0.2.1
Composer 安装命令:
composer require arcadis-intelligence/gomphplate
包简介
A wrapper for the yaml templating engine gomplate
关键字:
README 文档
README
Requirements
- PHP 8.0 or higher
- Gomplate
Configuration
You can specify the path to the gomplate binary by setting the GOMPLATE_PATH environment variable.
Installation
composer require arcadis-intelligence/gomphplate
Usage
use ArcadisIntelligence\Gomphplate\Gomphplate; $template = <<<YAML people: {{- range .people }} - name: {{ .name }} age: {{ .age }} {{- end }} YAML; $data = [ 'people' => [ ['name' => 'Alice', 'age' => 30], ['name' => 'Bob', 'age' => 25], ], ]; $renderedYaml = Gomphplate::renderYaml($template, $data);
Should produce
people: - name: Alice age: 30 - name: Bob age: 25
统计信息
- 总下载量: 86
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2025-02-19