PHPackages                             bupy7/php-html-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. bupy7/php-html-form

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

bupy7/php-html-form
===================

A basic framework agnostic form building package with a few extra niceties like remembering old input and retrieving error messages.

v2.0.5(6mo ago)618.3k—5.9%22MITPHPPHP &gt;=5.6CI passing

Since Oct 9Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/bupy7/php-html-form)[ Packagist](https://packagist.org/packages/bupy7/php-html-form)[ RSS](/packages/bupy7-php-html-form/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (2)Versions (39)Used By (2)

php-html-form
=============

[](#php-html-form)

This is fork of [adamwathan/form](https://github.com/adamwathan/form). There is just HTML-elements builder without any framework support. Extension are supporting PHP from 5.6 up to newest!

[![Stable Version](https://camo.githubusercontent.com/91f998148a6866ea044baffa6ee7e72413dbccae56956087cc4c1ad7796074c4/68747470733a2f2f706f7365722e707567782e6f72672f62757079372f7068702d68746d6c2d666f726d2f762f737461626c65)](https://packagist.org/packages/bupy7/php-html-form)[![Build status](https://github.com/bupy7/php-html-form/actions/workflows/build.yml/badge.svg)](https://github.com/bupy7/php-html-form/actions/workflows/build.yml)[![Coverage Status](https://camo.githubusercontent.com/6c4fa9b8ee79b88b1fc7082d2966f83c59a3b7125cbc88053b6f79ac523e46c0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f62757079372f7068702d68746d6c2d666f726d2f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/bupy7/php-html-form?branch=master)[![Total Downloads](https://camo.githubusercontent.com/5169e1e0a90f6f0d98b06b56b89ac28b77fdb2a92746795315d5ef7520e80407/68747470733a2f2f706f7365722e707567782e6f72672f62757079372f7068702d68746d6c2d666f726d2f646f776e6c6f616473)](https://packagist.org/packages/bupy7/php-html-form)[![License](https://camo.githubusercontent.com/35d7503d6e0377c5fb291a5f3d2568174d01cf24acdfef32edcf4fea8b70b2e5/68747470733a2f2f706f7365722e707567782e6f72672f62757079372f7068702d68746d6c2d666f726d2f6c6963656e7365)](https://packagist.org/packages/bupy7/php-html-form)

Boring name for a boring package. Builds form HTML with a fluent-ish, hopefully intuitive syntax.

- [Installation](#installation)
- [Basic Usage](#basic-usage)
- [Error Messages](#error-messages)
- [CSRF Protection](#csrf-protection)
- [Data Binding](#data-binding)

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

[](#installation)

You can install this package via Composer by running this command in your terminal in the root of your project:

```
$ composer require bupy7/php-html-form
```

Basic Usage
-----------

[](#basic-usage)

- [Getting Started](#getting-started)
- [Opening a Form](#opening-a-form)
- [Text and Password Fields](#text-and-password-fields)
- [Textareas](#textareas)
- [Checkboxes and Radio Buttons](#checkboxes-and-radio-buttons)
- [Selects](#selects)
- [Buttons](#buttons)
- [Hidden Inputs](#hidden-inputs)
- [Labels](#labels)
- [Setting Attributes](#setting-attributes)

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

[](#getting-started)

First, instantiate a FormBuilder...

```
$builder = new AdamWathan\Form\FormBuilder;
```

Next, use the FormBuilder to build an element. For example:

```
//
