phore/html
最新稳定版本:v0.4
Composer 安装命令:
composer require phore/html
包简介
Fluent HTML Template api
README 文档
README
- Fluent API for creating HTML Elements
- Create, alter, render
Basic example
// Create a div element: $elem = fhtml("div @id=main @class=website"); // Append a <div id=content> to the $elem[] = [ "div @id=content" => "Some Content" ]; // Append paragraph to content div: $elem["?#content"][] = ["p" => "Some escaped content"]; // Render full page including html-header echo $elem->renderPage();
will output:
<div id="main" class="website"> <div id="content"> Some Content <p>Some escaped content</p> </div> </div>
Creating html structures
$doc = fhtml("div @id=name2 @class=bordered");
$doc->alter();
Rendering Templates
Appending to Templates
Use the array append syntax ($template[] =) to append elements to
an existing element:
$t = fhtml();
$t[] = ["@h1" => "Hello World"];
统计信息
- 总下载量: 4.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-07-13