sabujdas94/html-template-parser
最新稳定版本:v1.0.3
Composer 安装命令:
composer require sabujdas94/html-template-parser
包简介
A secure Twig-based HTML template parser for user-provided templates input.
README 文档
README
You can find usage examples in the examples/ directory.
Basic Example
require 'path-to-your-package/vendor/autoload.php'; use SecureTemplateParser\SecureTemplateParser; $parser = new SecureTemplateParser(); $template = <<<EOT Hi {{ user.name }} {% if user.age > 18 %} You're eligible for adult benefits. {% else %} You're still a minor. {% endif %} EOT; $data = [ 'user' => [ 'name' => 'John Doe', 'age' => 25, ], ]; echo $parser->render($template, $data); ## License This package is open-source software licensed under the [MIT License](LICENSE).
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-12-05