PHPackages                             ptadmin/html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ptadmin/html

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ptadmin/html
============

简易使用php生成html标签的方法

v1.0.3(1y ago)01472MITPHPPHP ^7.0|^8.0

Since Aug 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/pangtou-com/ptadmin-html)[ Packagist](https://packagist.org/packages/ptadmin/html)[ Docs](https://github.com/ptadmin/html)[ RSS](/packages/ptadmin-html/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (2)

 [![PTAdmin](./public/logo.jpg)](https://www.pangtou.com)

ptadmin/html
============

[](#ptadminhtml)

[![Version](https://camo.githubusercontent.com/2cac45faff12d5772dd3f5c7af59159551ec4c1549759c9a30ce42c773260b49/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f707461646d696e2f68746d6c3f6c6162656c3d76657273696f6e)](https://packagist.org/packages/ptadmin/html)[![Downloads](https://camo.githubusercontent.com/36f2943db837c565a748062262c9688b3f7dfaaba90b59c93abd1ce9ca86436b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f707461646d696e2f68746d6c)](https://packagist.org/packages/ptadmin/html)[![License](https://camo.githubusercontent.com/30def1eb6c2a230e8358191c9d6a9e437c598d6785ddbb5288f3c2e1894c7b90/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f707461646d696e2f68746d6c)](https://packagist.org/packages/ptadmin/html)[![PTAdmin](https://camo.githubusercontent.com/c4c746592fe7f3c3fbe126f22eeae0fddc6545fbcd9e2ceb719355589ae4eb80/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d446f6373266d6573736167653d505441646d696e266c6f676f3d72656164746865646f6373)](https://www.pangtou.com)

### 安装

[](#安装)

> composer require ptadmin/html

### 使用方式

[](#使用方式)

```
    use PTAdmin\Html;

    # 预设html
    # 图片渲染
    Html::img($src, $option = []);
    # a标签生成
    Html::a($text, $url = null, $options = []);
    # label标签生成
    Html::label($content, $options = [], $for = null)
    # button标签
    Html::button($content = 'Button', $options = [])
    # 提交标签
    Html::submit($content = 'Submit', $options = [])
    # 重置标签
    Html::reset($content = 'Submit', $options = [])
    # 表单数据
    Html::input($type, $name = null, $value = null, $options = [])
    # text输入框
    Html::text($name = null, $value = null, $options = [])
    # 隐藏输入框
    Html::hidden($name = null, $value = null, $options = [])
    # 密码输入框
    Html::password($name = null, $value = null, $options = [])
    # 文件框
    Html::file($name = null, $value = null, $options = [])
    # 多行文本框
    Html::textarea($name = null, $value = null, $options = [])
    # 单选
    Html::radio($name = null, $checked = false, $options = [])
    # 多选
    Html::checkbox($name = null, $checked = false, $options = [])
    # select选择框
    Html::select($name, $items = [], $selection = null, $options = [])
    # 自定义html
    Html::tag($name, string $content = '', array $options = [])
```

### License

[](#license)

> MIT

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance42

Moderate activity, may be stable

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Total

4

Last Release

483d ago

PHP version history (2 changes)v1.0.0PHP ^7.1

v1.0.3PHP ^7.0|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/06e7fe1f698f7d2e0dc1fc119608759de78a83c5eb613c1c7c7146453ddc39bc?d=identicon)[873934580](/maintainers/873934580)

---

Top Contributors

[![zane-xin](https://avatars.githubusercontent.com/u/16483916?v=4)](https://github.com/zane-xin "zane-xin (13 commits)")

---

Tags

html

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/ptadmin-html/health.svg)

```
[![Health](https://phpackages.com/badges/ptadmin-html/health.svg)](https://phpackages.com/packages/ptadmin-html)
```

###  Alternatives

[spatie/laravel-html

A fluent html builder

8376.4M72](/packages/spatie-laravel-html)[ckeditor/ckeditor

JavaScript WYSIWYG web text editor.

5234.2M76](/packages/ckeditor-ckeditor)[caxy/php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

21520.9M15](/packages/caxy-php-htmldiff)[yajra/laravel-datatables-html

Laravel DataTables HTML builder plugin

2899.6M48](/packages/yajra-laravel-datatables-html)[wa72/htmlpagedom

jQuery-inspired DOM manipulation extension for Symfony's Crawler

3383.9M34](/packages/wa72-htmlpagedom)[tinymce/tinymce

Web based JavaScript HTML WYSIWYG editor control.

1697.5M106](/packages/tinymce-tinymce)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
