philipw/yaml-template-generator 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

philipw/yaml-template-generator

Composer 安装命令:

composer require philipw/yaml-template-generator

包简介

README 文档

README

Build Status

YAML/JSON Template Engine

This turns YAML/JSON files into templates that allows the user to pipe in params.

Example YAML template:

foo: {{ foo }}

Example params file:

{
	"foo" : "bar"
}

Output:

foo: bar

Universal Usage:

docker run -v ${workingdir}:/config \
	-e "TEMPLATEENGINE_TEMPLATEFILE=example/template.yaml" \
	-e "TEMPLATEENGINE_OUTPUTFILE=example/output.yaml" \
	-e "TEMPLATEENGINE_PARAMS=example/params.json" \
	-i philipw/yamltemplates

Bash Function: Put this bash function in your bash profile and you will be able to generate a templated yaml from anywhere on the CLI

function generateYaml() {
	TEMPLATEENGINE_TEMPLATEFILE=$0
	TEMPLATEENGINE_OUTPUTFILE=$1
	TEMPLATEENGINE_PARAMS=$2
	TEMPLATEENGINE_MIXIN=$3
	workingdir=$(pwd)

	docker run -v ${workingdir}:/config \
		-e "TEMPLATEENGINE_TEMPLATEFILE=${TEMPLATEENGINE_TEMPLATEFILE}" \
		-e "TEMPLATEENGINE_OUTPUTFILE=${TEMPLATEENGINE_OUTPUTFILE}" \
		-e "TEMPLATEENGINE_PARAMS=${TEMPLATEENGINE_PARAMS}" \
		-e "TEMPLATEENGINE_MIXIN=${TEMPLATEENGINE_MIXIN}" \
		-i philipw/yamltemplates
}

See examples folder for a more complete example.

PHP Lib Usage

Install via composer: philipw/yaml-template-generator

use TemplateEngine\Config;
use TemplateEngine\Template;

$config = new Config(__DIR__.'/example/params.json');
$template = new Template(
	$config, 
	__DIR__.'/example/example.yaml'
);

$template->writeRenderedOutput(__DIR__.'/output.yaml');

统计信息

  • 总下载量: 3
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2019-04-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固