PHPackages                             fgh151/yii2-form-fields - 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. [Templating &amp; Views](/categories/templating)
4. /
5. fgh151/yii2-form-fields

ActiveYii2-extension[Templating &amp; Views](/categories/templating)

fgh151/yii2-form-fields
=======================

Collection of form fields

0.0.17(1y ago)02.0k3MITPHP

Since Nov 23Pushed 1y ago1 watchersCompare

[ Source](https://github.com/fgh151/yii2-form-fields)[ Packagist](https://packagist.org/packages/fgh151/yii2-form-fields)[ RSS](/packages/fgh151-yii2-form-fields/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (14)Used By (0)

Yii2 form fields
================

[](#yii2-form-fields)

Collection of form fields

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist fgh151/yii2-form-fields "*"

```

or add

```
"fgh151/yii2-form-fields": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply use it in your code by :

```
$form = ActiveForm::begin();
echo \fgh151\fields\InputWidget::widget([
    'model' => $model,
    'attribute' => 'attributeName',
    'type' => \fgh151\fields\FieldTypes::getByName('text'), //default text
]);
ActiveForm::end();
```

Input without model

```
echo \fgh151\fields\InputWidget::widget([
    'model' => new \yii\base\DynamicModel(['attributeName']),
    'attribute' => 'attributeName',
]);
```

Input with custom label and value

```
echo \fgh151\fields\InputWidget::widget([
    'model' => new \yii\base\DynamicModel(['attributeName']),
    'attribute' => 'attributeName',
    'options' => [
                'label' => 'Custom label',
                'value' => 'Some value',
    ]
]);
```

Available field types:

- text - input type text
- email - input type email
- number - input type number
- textarea - text area
- binaryCheckbox - single check box (for example agree field)
- checkboxList - list check boxes with same name
- checkboxListOther - list check boxes with same name and input text field
- binaryRadio - single radio button
- radioList - list of radio buttons
- radioListOther - list of radio boxes with other text field
- file - file input field

BinaryCheckbox - is binary field, for example agree field

#### Field type examples

[](#field-type-examples)

##### checkboxList, checkboxListOther, radioList, radioListOther

[](#checkboxlist-checkboxlistother-radiolist-radiolistother)

```
echo \fgh151\fields\InputWidget::widget([
    'model' => new \yii\base\DynamicModel(['FirstName']),
    'attribute' => 'FirstName',
    'type' => 6, //You can specify direct see \fgh151\fields\FieldTypes
    'options' => [
        'variants' => [
            ['label' => 'var1', 'value' => 'var1'],
            ['label' => 'var2', 'value' => 'var2'],
            ['label' => 'var3', 'value' => 'var3'],
        ]
    ]
]);
```

for 'other' label you can pass custom text:

```
echo \fgh151\fields\InputWidget::widget([
    'model' => new \yii\base\DynamicModel(['FirstName']),
    'attribute' => 'FirstName',
    'type' => 6, //You can specify direct see \fgh151\fields\FieldTypes
    'options' => [
        'variants' => [
            ['label' => 'var1', 'value' => 'var1'],
            ['label' => 'var2', 'value' => 'var2'],
            ['label' => 'var3', 'value' => 'var3'],
        ]
    ],
    'otherText' => 'Другое'
]);
```

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance48

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 72.5% 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 ~253 days

Recently: every ~191 days

Total

13

Last Release

416d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81832b7ce373292df19cf8083a15a64210e41ecac3cd8184d80d9c81a85d86d1?d=identicon)[fgh151](/maintainers/fgh151)

---

Top Contributors

[![fgh151](https://avatars.githubusercontent.com/u/645524?v=4)](https://github.com/fgh151 "fgh151 (37 commits)")[![rmakhambetov](https://avatars.githubusercontent.com/u/21344624?v=4)](https://github.com/rmakhambetov "rmakhambetov (7 commits)")[![supersonic42](https://avatars.githubusercontent.com/u/18500722?v=4)](https://github.com/supersonic42 "supersonic42 (6 commits)")[![dalph](https://avatars.githubusercontent.com/u/5410433?v=4)](https://github.com/dalph "dalph (1 commits)")

---

Tags

yii2extensionformfields

### Embed Badge

![Health badge](/badges/fgh151-yii2-form-fields/health.svg)

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

###  Alternatives

[kartik-v/yii2-widget-select2

Enhanced Yii2 wrapper for the Select2 jQuery plugin (sub repo split from yii2-widgets).

3279.7M190](/packages/kartik-v-yii2-widget-select2)[kartik-v/yii2-widget-activeform

Enhanced Yii2 active-form and active-field with full bootstrap styling support (sub repo split from yii2-widgets).

647.3M62](/packages/kartik-v-yii2-widget-activeform)[raoul2000/yii2-bootswatch-asset

Use Bootswatch theme in your Yii application with minimum effort

2145.0k4](/packages/raoul2000-yii2-bootswatch-asset)[zxbodya/yii2-tinymce

Yii2 extension to use TinyMce with Compressor and FileManager

1732.1k3](/packages/zxbodya-yii2-tinymce)

PHPackages © 2026

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