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

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

nf/form
=======

Form builder

1.0.2(8y ago)18151MITPHP

Since Jan 10Pushed 7y ago2 watchersCompare

[ Source](https://github.com/nf-theme/form)[ Packagist](https://packagist.org/packages/nf/form)[ RSS](/packages/nf-form/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (4)Used By (1)

Forms &amp; HTML Builder
========================

[](#forms--html-builder)

- [Installation](#installation)
- [Opening A Form](#opening-a-form)
- [Labels](#labels)
- [Text, Text Area, Password &amp; Hidden Fields](#text)
- [Checkboxes and Radio Buttons](#checkboxes-and-radio-buttons)
- [File Input](#file-input)
- [Number Input](#number)
- [Date Input](#date)
- [Drop-Down Lists](#drop-down-lists)
- [Buttons](#buttons)

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

[](#installation)

Begin by installing this package through Composer.

```
composer require nf/form

```

Opening A Form
--------------

[](#opening-a-form)

```
$form = Form::open(['url' => 'foo/bar', 'method' => 'post', 'files' => true]);

$form .= Form::close();

echo $form;
```

You may also use it in view file

```
{!! Form::open(['url' => 'foo/bar', 'method' => 'post', 'files' => true]) !!}
    //
{!! Form::close() !!}
```

Labels
------

[](#labels)

#### Generating A Label Element

[](#generating-a-label-element)

```
echo Form::label('email', 'E-Mail Address');
```

#### Specifying Extra HTML Attributes

[](#specifying-extra-html-attributes)

```
echo Form::label('email', 'E-Mail Address', ['class' => 'awesome']);
```

> **Note:** After creating a label, any form element you create with a name matching the label name will automatically receive an ID matching the label name as well.

Text, Text Area, Password &amp; Hidden Fields
---------------------------------------------

[](#text-text-area-password--hidden-fields)

#### Generating A Text Input

[](#generating-a-text-input)

```
echo Form::text('username');
```

#### Specifying A Default Value

[](#specifying-a-default-value)

```
echo Form::text('email', 'example@gmail.com');
```

> **Note:** The *hidden* and *textarea* methods have the same signature as the *text* method.

#### Generating A Password Input

[](#generating-a-password-input)

```
echo Form::password('password', ['class' => 'awesome']);
```

#### Generating Other Inputs

[](#generating-other-inputs)

```
echo Form::email($name, $value = null, $attributes = []);
echo Form::file($name, $attributes = []);
```

Checkboxes and Radio Buttons
----------------------------

[](#checkboxes-and-radio-buttons)

#### Generating A Checkbox Or Radio Input

[](#generating-a-checkbox-or-radio-input)

```
echo Form::checkbox('name', 'value');

echo Form::radio('name', 'value');
```

#### Generating A Checkbox Or Radio Input That Is Checked

[](#generating-a-checkbox-or-radio-input-that-is-checked)

```
echo Form::checkbox('name', 'value', true);

echo Form::radio('name', 'value', true);
```

Number
------

[](#number)

#### Generating A Number Input

[](#generating-a-number-input)

```
echo Form::number('name', 'value');
```

Date
----

[](#date)

#### Generating A Date Input

[](#generating-a-date-input)

```
echo Form::date('name', \Carbon\Carbon::now());
```

File Input
----------

[](#file-input)

#### Generating A File Input

[](#generating-a-file-input)

```
echo Form::file('image');
```

> **Note:** The form must have been opened with the `files` option set to `true`.

Drop-Down Lists
---------------

[](#drop-down-lists)

#### Generating A Drop-Down List

[](#generating-a-drop-down-list)

```
echo Form::select('size', ['L' => 'Large', 'S' => 'Small']);
```

#### Generating A Drop-Down List With Selected Default

[](#generating-a-drop-down-list-with-selected-default)

```
echo Form::select('size', ['L' => 'Large', 'S' => 'Small'], 'S');
```

#### Generating a Drop-Down List With an Empty Placeholder

[](#generating-a-drop-down-list-with-an-empty-placeholder)

This will create an `` element with no value as the very first option of your drop-down.

```
echo Form::select('size', ['L' => 'Large', 'S' => 'Small'], null, ['placeholder' => 'Pick a size...']);
```

#### Generating A Grouped List

[](#generating-a-grouped-list)

```
echo Form::select('animal',[
    'Cats' => ['leopard' => 'Leopard'],
    'Dogs' => ['spaniel' => 'Spaniel'],
]);
```

#### Generating A Drop-Down List With A Range

[](#generating-a-drop-down-list-with-a-range)

```
echo Form::selectRange('number', 10, 20);
```

#### Generating A List With Month Names

[](#generating-a-list-with-month-names)

```
echo Form::selectMonth('month');
```

#### Generating A List of years

[](#generating-a-list-of-years)

```
echo Form::year('year', 1990, 2018);
```

Buttons
-------

[](#buttons)

#### Generating A Submit Button

[](#generating-a-submit-button)

```
echo Form::submit('Click Me!');
```

> **Note:** Need to create a button element? Try the *button* method. It has the same signature as *submit*.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity65

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

Total

3

Last Release

3047d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/3bbdd95f61a0f401f1df7329c631647011c2ff72a745afe50f70d0ca7ad871ed?d=identicon)[khiemchay](/maintainers/khiemchay)

---

Top Contributors

[![nightfury-est](https://avatars.githubusercontent.com/u/20170474?v=4)](https://github.com/nightfury-est "nightfury-est (3 commits)")

### Embed Badge

![Health badge](/badges/nf-form/health.svg)

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

###  Alternatives

[nxp/russian-porter-stemmer

Russian porter stemmer

4490.2k1](/packages/nxp-russian-porter-stemmer)

PHPackages © 2026

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