thijzer/html-builder

简单的PHP Html组件构建器

1.0.1 2019-07-20 19:51 UTC

This package is auto-updated.

Last update: 2024-09-15 02:12:58 UTC


README

目标

此存储库旨在使动态HTML元素更容易使用。大多数已知组件都应该作为一个集合提供。

使其可能以对象的形式在PHP中构建菜单、数据网格、表格组件,并将它们传递给模板引擎。

示例

$table = new \HtmlBuilder\Table();
$table->setData($dataSet);
$table
    ->add('#', 'rowcount')
    ->add('title')
    ->add('status_code')
    ->add('h1_count')
    ->add('frequency')
    ->add('links_text', 'arrayCount')
    ->add('visited', 'boolean')
    ->add('absolute_url', 'link')
;
$table->render()