PHPackages                             myjw3b/php-bootstrap-form-class - 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. myjw3b/php-bootstrap-form-class

ActiveProject

myjw3b/php-bootstrap-form-class
===============================

Some form building helpers for bootstrap 4 &amp; 5

1.1.0(1y ago)038MITPHPPHP ^8.0

Since Jun 21Pushed 1y agoCompare

[ Source](https://github.com/myJW3B/PHP-Bootstrap-Form-Class)[ Packagist](https://packagist.org/packages/myjw3b/php-bootstrap-form-class)[ RSS](/packages/myjw3b-php-bootstrap-form-class/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)DependenciesVersions (8)Used By (0)

PHP-Bootstrap-Form-Class
========================

[](#php-bootstrap-form-class)

Build your HTML for all your forms fast and easily with a wrapper that builds it for you with only a few variables.

We can add floating labels, input groups or use the row / col combo to each element.

### Disclaimer

[](#disclaimer)

I have not used the input groups after some recent changes to the class brought about by the floating labels.

Functions
---------

[](#functions)

95% will return `$this` to make them chain-able.

### \_\_construct()

[](#__construct)

Default options for the new form() construction.

```
$options = [
			'id'            => '',  // id of the form element
			'url'           => '/ajax', // the forms action value
			'method'        => 'post', // get or post
			'form_classes'  => 'mf-forms', // classes to be added to the form tag
			'input_classes' => 'form-control', // classes to be added to the input elements
			'row_classes'   => 'mb-3', // classes to be added to each container row
			'form_attr'     => [], // additional form attributes
			'ensure_row'    => true // ensure the rows are closed before each new element
		]
```

### `->set_opts($key, $value)`

[](#-set_optskey-value)

You can override some options originally set by the constructor Returns `$this` so it can be chained.

### `->get_opts($key)`

[](#-get_optskey)

Returns the value of the option key, so cannot be chained.

### `->add_html($html, $close_row=false)`

[](#-add_htmlhtml-close_rowfalse)

Adds additional HTML within the form

### `->floating($additional_classes='')`

[](#-floatingadditional_classes)

To start a floating label block

### `->new_row($row_class='')`

[](#-new_rowrow_class)

### `->set_name($input_name_and_id_value='')`

[](#-set_nameinput_name_and_id_value)

You can put `['key']` in the names value to work with radio and checkboxes.

Element
-------

[](#element)

Floating labels are automatically added after the input tag

```
/**
	 *  @param (str) type = 'input', 'button', 'textarea', 'select', 'file', 'day', 'time':
	 * 	@param (str) value of input
	 *  @param (ary) attr for the input
	 *  @param (ary) b4_element - input
	 *  @param (ary) after_element - input
	 *
	 * return $this
	 */
```

Example
-------

[](#example)

```
    $new_form = new form([
		'id' => 'register-form',
		'url' => '/ajax/register-form',
		'form_classes' => 'col-lg-6 mx-auto'
	]);
	$inc = $new_form
		->floating()
			->set_name('uUsername')
			->element('input', '', ['placeholder' => 'My Crazy Name', 'required' => 'required'])
		->end_floating()
		->floating()
			->set_name('uEmail')
			->element('input', '', ['type' => 'email', 'placeholder' => 'Real Email', 'required' => 'required'])
		->end_floating()
		->floating()
			->set_name('uPass')
			->element('input', '', ['type' => 'password', 'placeholder' => 'Password', 'required' => 'required'])
		->end_floating()
		->floating()
			->set_name('uPassCon')
			->element('input', '', ['type' => 'password', 'placeholder' => 'Confirm Password', 'required' => 'required'])
		->end_floating()
		->actions();
```

More examples to come soon

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Total

7

Last Release

669d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c53f441885ec90d8d6e547f4c9023da12f10229c3848059e19b6aba9be1859a?d=identicon)[Yohn](/maintainers/Yohn)

---

Top Contributors

[![Yohn](https://avatars.githubusercontent.com/u/2002591?v=4)](https://github.com/Yohn "Yohn (48 commits)")

### Embed Badge

![Health badge](/badges/myjw3b-php-bootstrap-form-class/health.svg)

```
[![Health](https://phpackages.com/badges/myjw3b-php-bootstrap-form-class/health.svg)](https://phpackages.com/packages/myjw3b-php-bootstrap-form-class)
```

PHPackages © 2026

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