PHPackages                             cbatista8a/formbuilder - 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. cbatista8a/formbuilder

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

cbatista8a/formbuilder
======================

1.2.0(3y ago)19MITPHPPHP &gt;=7.4

Since May 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/cbatista8a/formbuilder)[ Packagist](https://packagist.org/packages/cbatista8a/formbuilder)[ RSS](/packages/cbatista8a-formbuilder/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (4)Used By (0)

FormBuilder
===========

[](#formbuilder)

Simple POO Form Builder for PHP projects

Getting Started
---------------

[](#getting-started)

These instructions will give you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

[](#prerequisites)

- PHP 7.4
- [composer](https://getcomposer.org)

### Installing

[](#installing)

clone repo from GitHub

```
git clone https://github.com/cbatista8a/formbuilder.git

```

or

```
composer require cbatista8a/formbuilder

```

use autoload

```
require_once './vendor/autoload.php';

```

Create the Form Object and add some elements and attributes

```
$form = new FormBuilder();
$form->addAttribute(new Attribute('id','form-test'))
 ->addAttribute(new Attribute('action','example.php'))
 ->addAttribute(new Attribute('class','form-group'))
 ->extractObjectFields($model,'model-group','row')
 ->addElement(new Button('submit','Save'),'form-footer');

```

If your are ready, just render the HTML and enjoy

```
echo $form->build();

```

`Element` is an abstract class and it's the parent of all other HTML Tags

`Input` is a basic element of any HTML Form, this is an example of its implementation:

```
class Input extends Element
{

    private string $type;

    public function __construct(string $type)
    {
        $this->type = $type;
    }

    /**
     * @return string
     */
    public function getType(): string
    {
        return $this->type;
    }

    public function render(): string
    {
        return "renderHtmlAttributes()}
                >
        ";
    }
}

```

Don't implement this basic element, it's already present on this library

Built With Love and
-------------------

[](#built-with-love-and)

- PHP
- composer

Contributing
------------

[](#contributing)

You are invited to do pull requests and contribute with us.

Versioning
----------

[](#versioning)

We use [Semantic Versioning](http://semver.org/)

Authors
-------

[](#authors)

- **Carlos Batista**

License
-------

[](#license)

This project is licensed under the [MIT](https://mit-license.org/) License - see the [LICENSE.md](LICENSE.md) file for details.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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 ~136 days

Total

3

Last Release

1247d ago

PHP version history (2 changes)1.0PHP &gt;=7.2

1.2.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/40b582c610d5d33636fea13fd72a9a8012820ed5c4d30afda8eeb5c4736382f4?d=identicon)[cbatista8a](/maintainers/cbatista8a)

---

Top Contributors

[![cbatista8a](https://avatars.githubusercontent.com/u/59052959?v=4)](https://github.com/cbatista8a "cbatista8a (42 commits)")

### Embed Badge

![Health badge](/badges/cbatista8a-formbuilder/health.svg)

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

###  Alternatives

[lamoda/enum-bundle

Utility wrapper around PHP-enum

101.6k](/packages/lamoda-enum-bundle)

PHPackages © 2026

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