h4d/template
Composer 安装命令:
composer require h4d/template
包简介
Basic PHP template system
关键字:
README 文档
README
This is a very basic PHP library that helps you work with plain text format templates (txt, html, etc).
Install via composer:
Install the latest version with
$ composer require h4d/template
Basic usage examples
Using constructor
<?php
// Create a template
$template = new \H4D\Template\Template();
// Add vars to the template object
$template->addVar('name', 'WORLD');
// Render using the given file as template
echo $template->render('./template.txt');
Using static method (the fast way)
<?php
// Create a template & set the template file
$template = \H4D\Template\Template::create('./template.txt');
// Add vars to the template object
$template->addVar('name', '(static) WORLD');
// Render template (automagically cast to string)
echo $template;
统计信息
- 总下载量: 255
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-19