helium/template-package
Composer 安装命令:
composer require helium/template-package
包简介
Messaging Templating Package
README 文档
README
Welcome to the Helium's universal template engine. This engine uses dependency injection to swap different templating engines in and out of your application.
How To Use
The main file is the Template file, where the engines are the engine name file by engine. For example, MustacheEngine.php. Multiple engines can be implemented and swapped as such.
use helium\Template\Template;
use helium\Template\MustacheEngine;
use helium\Template\BladeEngine;
//These placeholders will change per engine
$string = 'Replace values {first_name} {last_name}';
//Data to replace with values
$data = ['first_name' => 'John', 'last_name' => 'Doe'];
$template = new Template(new MustacheEngine());
$template -> render($string, $data);
//This example use Blade, which requires that you have
//a writable and readable directory setup
$template = new Template(new BladeEngine('/views/users', '/tmp'));
$template->render('username', $data);
统计信息
- 总下载量: 1.29k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2020-02-12