sabujdas94/html-template-parser 问题修复 & 功能扩展

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

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

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-05