ryancco/canon
最新稳定版本:v0.3
Composer 安装命令:
composer require ryancco/canon
包简介
Generate files from templates
README 文档
README
Generate files from templates in PHP. Useful in development for templating commonly created files or files with extensive boilerplate or formatting. Leverage the full power of your preferred templating language by implementing the Ryancco\Canon\Contracts\Compiler interface. This package includes a dependency-free, "pure PHP" implementation that supports simple variable replacement as well as an implementation for the Blade templating engine and the Twig templating engine. Each require you add the respective compiler engine to your project dependencies.
Write or read files to and from separate filesystems including local, S/FTP, AWS S3 and more by requiring any of the supported Flysystem adapters.
Installation
You can install the package via composer:
composer require [--dev] ryancco/canon
Usage
use Ryancco\Canon; $canon = new Canon($filesystem); // using a template file $canon->generate('hello-world.txt', 'filename.out', ['name' => 'World']); // using a template string $canon->generate('Hello, { name }.', 'filename.out', ['name' => 'World']);
Testing
composer test
Changelog
Please see the Release Notes for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-08-04