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

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

b2pweb/bdf-form
===============

Simple and flexible form library

v1.7.1(3w ago)36.5k↓67.1%[2 PRs](https://github.com/b2pweb/bdf-form/pulls)2MITPHPPHP &gt;=7.4CI passing

Since Mar 2Pushed 3w ago2 watchersCompare

[ Source](https://github.com/b2pweb/bdf-form)[ Packagist](https://packagist.org/packages/b2pweb/bdf-form)[ RSS](/packages/b2pweb-bdf-form/feed)WikiDiscussions 2.0 Synced 2d ago

READMEChangelogDependencies (27)Versions (26)Used By (2)

BDF Form
========

[](#bdf-form)

Library for handle form, and request validation.

[![build](https://github.com/b2pweb/bdf-form/actions/workflows/php.yml/badge.svg)](https://github.com/b2pweb/bdf-form/actions/workflows/php.yml)[![codecov](https://camo.githubusercontent.com/a61f9ede589d29f9fb52b9b89c860a7b3df8d892d2a9a90069730bd674f6d563/68747470733a2f2f636f6465636f762e696f2f6769746875622f6232707765622f6264662d666f726d2f6272616e63682f312e362f67726170682f62616467652e7376673f746f6b656e3d564f4653504557594b58)](https://app.codecov.io/github/b2pweb/bdf-form)[![Packagist Version](https://camo.githubusercontent.com/30f5c7cd2f15d34b98f64719217fb529d5925bde1d140ad024f25e98f0a8a528/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6232707765622f6264662d666f726d2e737667)](https://packagist.org/packages/b2pweb/bdf-form)[![Total Downloads](https://camo.githubusercontent.com/05085a73fcf326e838b546ac1f50c04f5ea49b460d151db0fb649bbd26cda12a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6232707765622f6264662d666f726d2e737667)](https://packagist.org/packages/b2pweb/bdf-form)[![Type Coverage](https://camo.githubusercontent.com/0fb3071d0c770cc12732a70fa4b5d5d73abbd933aa310616e2110bc3e6dd9a00/68747470733a2f2f73686570686572642e6465762f6769746875622f6232707765622f6264662d666f726d2f636f7665726167652e737667)](https://shepherd.dev/github/b2pweb/bdf-form)

Table of content
----------------

[](#table-of-content)

- [Installation using composer](#installation-using-composer)
- [Basic usage](#basic-usage)
- [Handle entities](#handle-entities)
- [Transformation process](#transformation-process)
- [Embedded and array](#embedded-and-array)
- [Field path and dependencies](#field-path-and-dependencies)
- [Choices](#choices)
- [Buttons](#buttons)
- [Elements](#elements)
    - [StringElement](#stringelement)
        - [Email](#email)
        - [Url](#url)
    - [IntegerElement](#integerelement)
    - [FloatElement](#floatelement)
    - [BooleanElement](#booleanelement)
    - [DateTimeElement](#datetimeelement)
    - [PhoneElement](#phoneelement)
    - [CsrfElement](#csrfelement)
    - [AnyElement](#anyelement)
- [Create a custom element](#create-a-custom-element)
    - [Using custom form](#using-custom-form)
    - [Using LeafElement](#using-leafelement)
    - [Usage](#usage)
    - [Custom child builder](#custom-child-builder)
- [Error Handling](#error-handling)
    - [Simple usage](#simple-usage)
    - [Printer](#printer)
- [Using PHP 8 attributes](#using-php-8-attributes)

Installation using composer
---------------------------

[](#installation-using-composer)

```
composer require b2pweb/bdf-form

```

Basic usage
-----------

[](#basic-usage)

To create a form, simply extends the class [`CustomForm`](src/Custom/CustomForm.php) and implements method `CustomForm::configure()` :

```
