shish/microhtml 问题修复 & 功能扩展

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

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

shish/microhtml

最新稳定版本:v2.5.0

Composer 安装命令:

composer require shish/microhtml

包简介

A minimal HTML generating library

README 文档

README

Moving from Hack to vanilla PHP, I miss XHP T__T

This isn't XHP, but it does provide a minimum-bullshit method of generating HTML in a consistent and secure manner

<?php

use function MicroHTML\{HTML,SECTION,H1,P,DIV};

$page = HTML(
    SECTION(["id"=>"news"],
        H1("My title"),
        P("Here's some content")
    )
);

$page->appendChild(
    SECTION(["id"=>"comments"],
        DIV("Oh noes: <script>alert('a haxxor is attacking us');</script>")
    )
);

print($page);
<html>
    <section id='news'>
        <h1>My title</h1>
        <p>Here&#039;s some content</p>
    </section>
    <section id='comments'>
        <div>Oh noes: &lt;script&gt;alert(&#039;a haxxor is attacking us&#039;);&lt;/script&gt;</div>
    </section>
</html>

Testing

composer install
composer check

Release

git tag v1.2.3
git push --tags

统计信息

  • 总下载量: 35.71k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-09-21