siriusphp/html
最新稳定版本:2.0.0
Composer 安装命令:
composer require siriusphp/html
包简介
HTML rendering library with an API inspired by jQuery and React
README 文档
README
Framework agnostic HTML rendering utility with an API inspired by jQuery and React.
Elevator pitch
$h = new Sirius\Html\Builder; $h->registerTag('user-login-form', 'MyApp\Html\Components\UserLoginForm'); echo $h->make('user-login-form', ['_form_values' => $_POST]);
which will output something like
<form method="post" action="user/login" class="form form-inline"> <div class="form-control"> <label for="email">Email/Username:</label> <input type="email" name="email" id="email" value="me@domain.com"> </div> <!-- the rest of the form goes here --> </form>
Performance
There is a simple benchmark that renders a form with 4 fields and a button. Compared to Twig, Sirius HTML is 50% slower but uses 2x less memory.
The benchmark results are as follows for 100K iterations:
| Library | Time | Memory |
|---|---|---|
| Sirius HTML | 1.78s | 2Mb |
| Twig | 1.14s | 4Mb |
Of course, this is not a real world scenario, but it gives you an idea of what to expect from this library.
Links
统计信息
- 总下载量: 62
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-02-18