PHPackages                             digphp/form - 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. digphp/form

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

digphp/form
===========

表单生成器

1.0.0(4y ago)0121GPL-3.0PHP

Since Mar 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/digphp/form)[ Packagist](https://packagist.org/packages/digphp/form)[ RSS](/packages/digphp-form/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (1)

表单生成器
=====

[](#表单生成器)

生成bootstrap样式的表单

安装
--

[](#安装)

```
composer require digphp/form
```

用例
--

[](#用例)

```
use DigPHP\Form\Builder;
use DigPHP\Form\Col;
use DigPHP\Form\Row;
use DigPHP\Form\Field\Checkbox;
use DigPHP\Form\Field\Code;
use DigPHP\Form\Field\Cover;
use DigPHP\Form\Field\Files;
use DigPHP\Form\Field\Input;
use DigPHP\Form\Field\Pics;
use DigPHP\Form\Field\Radio;
use DigPHP\Form\Field\Select;
use DigPHP\Form\Field\SimpleMDE;
use DigPHP\Form\Field\Summernote;
use DigPHP\Form\Field\Switchs;
use DigPHP\Form\Field\Textarea;

$builder = new Builder('表单');
$builder->addItem(
    new Row(
        (new Col('col-md-3'))->addItem(
            (new Input('单行文本', '字段1', '默认值')),
            (new Select('下拉选择', '字段2', '默认值'))->set('items', ['选项一', '选项二']),
            (new Checkbox('多选框', '字段3', ['选中值']))->set('items', ['选中值', '可选值2']),
            (new Radio('单选', '字段4', '选中值'))->set('items', ['选中值', '可选值2', '可选值3']),
            (new SimpleMDE('Markdown编辑器', '字段5', '# 我是标题')),
            (new Summernote('富文本编辑器', '字段6', '我是默认值')),
            (new Textarea('多行文本', '字段7', '我是多行文本默认值'))
        ),
        (new Col('col-md-9'))->addItem(
            (new Code('代码编辑框', 'codex', '我是值')),
            (new Cover('单图上传', 'cover', 'http://....jpg')),
            (new Files('多文件上传', 'asdfas', [])),
            (new Pics('多图片上传', 'asdfas', [])),
            (new Switchs('选项切换', 'switch', 'dww'))->addSwitch('kkj', 'sd', 'adfsdf')->addSwitch('sdfsdf', 'dww', 'asdf')
        ),
    ),
    new Input('另一个单行文本', 'FES', 'DFS')
);

echo $builder;
```

示例图
---

[](#示例图)

[![image](https://user-images.githubusercontent.com/96121255/146198910-3ad819bb-8920-48f9-9902-386b92e44b2f.png)](https://user-images.githubusercontent.com/96121255/146198910-3ad819bb-8920-48f9-9902-386b92e44b2f.png)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

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

Unknown

Total

1

Last Release

1525d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f462934f8ed14974526240d3f3732144c90bef87038d8ede35a70dc315610696?d=identicon)[digphp](/maintainers/digphp)

---

Top Contributors

[![wseng](https://avatars.githubusercontent.com/u/6572161?v=4)](https://github.com/wseng "wseng (7 commits)")

### Embed Badge

![Health badge](/badges/digphp-form/health.svg)

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

###  Alternatives

[yurunsoft/swoole-co-pool

26388.0k1](/packages/yurunsoft-swoole-co-pool)[burdamagazinorg/thunder-project

Project template for Thunder projects with composer

2727.1k](/packages/burdamagazinorg-thunder-project)

PHPackages © 2026

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