PHPackages                             valksystems/bootbuilder - 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. valksystems/bootbuilder

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

valksystems/bootbuilder
=======================

Easy bootstrap form builder in OOP PHP. You can generate forms from object oriented form building with PHP code.

v1.2.1(10y ago)261MITPHPPHP &gt;=5.4.0

Since Mar 31Pushed 10y ago2 watchersCompare

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

READMEChangelog (4)Dependencies (1)Versions (6)Used By (0)

[![Build status](https://camo.githubusercontent.com/3a5a05d7167d8fdf2eeb1ac995b6045abedb5523276015c9f538b7d03c7d4701/68747470733a2f2f7472617669732d63692e6f72672f56616c6b53797374656d732f626f6f746275696c6465722e737667)](https://travis-ci.org/ValkSystems/bootbuilder) [![Codacy Badge](https://camo.githubusercontent.com/b592ce33613be001a007a2de062db67313e69185ff0d28df55e41070975128d6/68747470733a2f2f7777772e636f646163792e636f6d2f70726f6a6563742f62616467652f3465386537313132613064623435666539383836366632326438326431303636)](https://www.codacy.com/app/tomvalk/bootbuilder)

BootBuilder
===========

[](#bootbuilder)

Bootstrap Form Building made easy in PHP.

Installation
------------

[](#installation)

You can install the package with Composer, check out composer on

Add the following to the required in the composer.json:

```
"valksystems/bootbuilder": ">=1.0.0"

```

Or execute the following composer command:

```
composer require 'valksystems/bootbuilder:1*'

```

Usage
-----

[](#usage)

Checkout the demo folder for demo's with the controls and different styles of forms

### Forms

[](#forms)

First of all, you have to create a Form object. There are 2 options right now. Just a normal form and a horizontal form (look at bootstrap page for more information).

To create a form use:

```
$form = BootBuilder::open();

// Horizontal Form
$horizontal = BootBuilder::openHorizontal();
```

On the form object you can set the properties of a normal form with the following methods:

```
setAction($action) // Set the action attribute
setClass($class) // set class (this will replace current class)
setId($id) // set the id of the form
setMethod($method) // set the method, either get or post
```

To add controls or panes to the form, use:

```
$form->add($control);

// Or when adding multiple controls/panes at the same time:
$form->addAll($pane1, $control, $submit);
```

##### HorizontalForm

[](#horizontalform)

On a horizontal form you can set 2 more parameters for the grid layout. To set the layout parameters, use the following methods:

```
$horizontal->setLabelCol($label_col) // for example col-md-3
$horizontal->setControlCol($control_col) // for example col-md-9
```

#### Rendering

[](#rendering)

To render the form you simply call `render()`. You can also get the rendered HTML back with `render(true)`.

### Controls

[](#controls)

You can use the following controls, in fully bootstrap styles:

- Button
- Submit (Button)
- Checkbox
- Radio
- Text (input type=text)
- Number (input type=number)
- Email (input type=email)
- TextArea
- Hidden (input type=hidden)
- Password (input type=password)
- Select

##### Default operations on controls

[](#default-operations-on-controls)

To create a new control. Construct the class for the control with:

```
use \bootbuilder\Controls\Text;

$text = new Text("name");
// Or you can directly give it a label, ID and value with the optional constructor parameters
$text = new Text("name", "Please enter your name", "name_id", "Current Name");
```

On all the controls you can set the name, id, class(es), value, placeholder, label text, required (y/n), disabled (y/n), readonly (y/n), errorstate (y/n) and helptext with simple methods:

```
setId($id) // set the id of the control tag (//etc)
setClass($class), addClass($class), removeClass($class) // Edit the current class(es)
setValue($value) // set the value of the control. (not filtered!!)
setPlaceholder($placeholder) // set the placeholder
setLabel($labeltext) // set the label text, for using when rendering in a supported form
setRequired($required) // set if the control is required (note, browser can be manipulated)
setDisabled($disabled) // set disabled state
setReadOnly($readonle) // set readonly state
setErrorState($errorstate) // set if the control is in error state
setHelpText($helptext) // set helptext for under the control
```

After creating you can either add it to a pane or to the form directly.

##### Text

[](#text)

You can enter a custom type of input now, with the method `setType($type)`

##### TextArea

[](#textarea)

On a TextArea object you can set the optional rows parameter with the method `setRows($rows)`

##### Select

[](#select)

To set the data in the select control (the options), use the following method:

```
$options = array("key_value" => "Key Value");
setOptions($options);
```

The $options need to have an array with: \[value\] = "Readable text".

### Panes

[](#panes)

You can combine controls with panes, it's like an group with elements, but specific with the style it has. Currently there are 2 panes, StackPane and InlinePane

To create a pane and add controls to it use:

```
$pane = new StackPane("Label Here");
$pane->addControl($control);

$form->add($pane);
```

##### StackPane

[](#stackpane)

StackPane will combine elements, each on a new row. Just adding it below it.

##### InlinePane

[](#inlinepane)

InlinePane will make the supported controls (checkbox and radio) display with an in-line style. See  for more information.

License
-------

[](#license)

This project is under MIT License, see LICENSE file.

Resposibility
-------------

[](#resposibility)

We are not resposible for any security problems, always check code before you are going to use it!

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

4

Last Release

3951d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v1.2.0PHP &gt;=5.4.0

### Community

Maintainers

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

---

Top Contributors

[![tomvlk](https://avatars.githubusercontent.com/u/3877688?v=4)](https://github.com/tomvlk "tomvlk (65 commits)")

---

Tags

builderbootstrapform

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/valksystems-bootbuilder/health.svg)

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

###  Alternatives

[snapappointments/bootstrap-select

The jQuery plugin that brings select elements into the 21st century with intuitive multiselection, searching, and much more. Now with Bootstrap 4 support.

9.8k480.4k3](/packages/snapappointments-bootstrap-select)[kris/laravel-form-builder

Laravel form builder - symfony like

1.7k2.2M45](/packages/kris-laravel-form-builder)[anahkiasen/former

A powerful form builder

1.4k1.4M14](/packages/anahkiasen-former)[kevinchappell/form-builder

jQuery formBuilder

2.7k6.9k2](/packages/kevinchappell-form-builder)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[kartik-v/yii2-widget-timepicker

Enhanced Yii2 wrapper for the bootstrap timepicker plugin (sub repo split from yii2-widgets)

404.9M14](/packages/kartik-v-yii2-widget-timepicker)

PHPackages © 2026

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