PHPackages                             kartik-v/yii2-widget-activeform - 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. kartik-v/yii2-widget-activeform

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

kartik-v/yii2-widget-activeform
===============================

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

v1.6.4(2y ago)647.3M↓10.5%34[5 issues](https://github.com/kartik-v/yii2-widget-activeform/issues)[1 PRs](https://github.com/kartik-v/yii2-widget-activeform/pulls)20BSD-3-ClausePHP

Since Nov 9Pushed 1y ago4 watchersCompare

[ Source](https://github.com/kartik-v/yii2-widget-activeform)[ Packagist](https://packagist.org/packages/kartik-v/yii2-widget-activeform)[ Docs](https://github.com/kartik-v/yii2-widget-activeform)[ Fund](https://opencollective.com/yii2-widgets)[ RSS](/packages/kartik-v-yii2-widget-activeform/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (30)Used By (20)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://demos.krajee.com "Krajee Demos")
 yii2-widget-activeform ---

 [![Donate](https://camo.githubusercontent.com/0336bc43d88554a3f2d6c74dddf312bc2c65c2eacca70d83ae40f5567098d00e/68747470733a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal") [![kartikv](https://camo.githubusercontent.com/0cf29a542375e1a46e84d8bf5805a4e5c0a6ee98b6547ccdc0c55eed49d99c69/68747470733a2f2f63646e2e6275796d6561636f666665652e636f6d2f627574746f6e732f76322f64656661756c742d79656c6c6f772e706e67)](https://www.buymeacoffee.com/kartikv "Buy me a coffee")
=========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-widget-activeform------------------)

[![Stable Version](https://camo.githubusercontent.com/55d120607f6b9eb699aa75c32ea2f8c71f7962868f39069d59dba0b15688aa76/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616374697665666f726d2f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-widget-activeform)[![Unstable Version](https://camo.githubusercontent.com/479093aa3ff439b920d4bad426c0aefa87f9847adad25859ae8e326f9d301456/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616374697665666f726d2f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-widget-activeform)[![License](https://camo.githubusercontent.com/49bab9f1c5c51678b916bcf9c7631dd74d0a010bbe6f0ace7dfb884020fa8b60/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616374697665666f726d2f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-widget-activeform)[![Total Downloads](https://camo.githubusercontent.com/8aadf7cbf6a41cdc503801c1e34e155682ed9a50c86dd8f307f5662bf0b6adcd/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616374697665666f726d2f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-widget-activeform)[![Monthly Downloads](https://camo.githubusercontent.com/fc00648ebefbb5552dff393cceea8f1348e1911718b8687c20270f12d2955a60/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616374697665666f726d2f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-widget-activeform)[![Daily Downloads](https://camo.githubusercontent.com/5c25af230df87012809a0de2c047be61a64debe410baf730d84cd3c64df86674/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d7769646765742d616374697665666f726d2f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-widget-activeform)

Extends and enhances the [Yii ActiveForm widget](https://github.com/yiisoft/yii2/blob/master/framework/widgets/ActiveForm.php). Facilitates all [three form layouts](http://getbootstrap.com/css/#forms-example) available in Bootstrap i.e. **vertical**, **horizontal**, and **inline**. Allows options for offsetting labels and inputs for horizontal form layout. Works closely with the extended ActiveField component. In addition, this extension enhances and extends the [Yii ActiveField component](https://github.com/yiisoft/yii2/blob/master/framework/widgets/ActiveField.php). Allows Bootstrap styled [input group addons](http://getbootstrap.com/components/#input-groups-basic) to be prepended or appended to textInputs. Implements [feedback icons](http://getbootstrap.com/css/#with-optional-icons) within inputs based on contextual states. Automatically adjusts checkboxes and radio input offsets for horizontal forms. Allows, flexibility to control the labels and placeholders based on form layout style (e.g. hide labels and show them as placeholder for inline forms). The extended ActiveField functionalities available are:

- Addons
    - Prepend Addon
    - Append Addon
    - Icon Addon
    - Input Addon
    - Button Addon
    - Button Dropdown Addon
    - Segmented Button Addon
    - Prepend &amp; Append
    - Input Group Settings
    - Multiple Addons Configuration (*new* since v1.4.9)
- Input Feedback Icons
- Input Hints Management
- Inputs
    - Checkbox
    - Radio
    - Checkbox List
    - Radio List
    - Static Input
    - HTML 5 Input
    - Checkbox Button Group
    - Radio Button Group
- Multi Select
    - Vertical Form
    - Horizontal Form
    - Radio List
    - Display Options

> NOTE: This extension is a sub repo split of [yii2-widgets](https://github.com/kartik-v/yii2-widgets). The split has been done since 08-Nov-2014 to allow developers to install this specific widget in isolation if needed. One can also use the extension the previous way with the whole suite of [yii2-widgets](http://demos.krajee.com/widgets).

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/kartik-v/yii2-widget-activeform/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

To install, either run

```
$ php composer.phar require kartik-v/yii2-widget-activeform "@dev"

```

or add

```
"kartik-v/yii2-widget-activeform": "@dev"

```

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

Release Changes
---------------

[](#release-changes)

> NOTE: Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-widget-activeform/blob/master/CHANGE.md) for details on changes to various releases.

Demo
----

[](#demo)

You can refer detailed documentation and demos for understanding the usage of the extension at these links below:

- [ActiveForm](http://demos.krajee.com/widget-details/active-form)
- [ActiveField](http://demos.krajee.com/widget-details/active-field)
- [Html5Input](http://demos.krajee.com/html5-demo)

Usage
-----

[](#usage)

### ActiveForm

[](#activeform)

```
// add this in your view
use kartik\form\ActiveForm;

// Vertical Form
$form = ActiveForm::begin([
    'id' => 'form-signup',
    'type' => ActiveForm::TYPE_VERTICAL
]);

// Inline Form
$form = ActiveForm::begin([
    'id' => 'form-login',
    'type' => ActiveForm::TYPE_INLINE,
    'fieldConfig' => ['autoPlaceholder'=>true]
]);

// Horizontal Form Configuration
$form = ActiveForm::begin([
    'id' => 'form-signup',
    'type' => ActiveForm::TYPE_HORIZONTAL,
    'formConfig' => ['labelSpan' => 3, 'deviceSize' => ActiveForm::SIZE_SMALL]
]);
```

### ActiveField

[](#activefield)

```
// Implement a feedback icon
echo $form->field($model, 'email_2', [
    'feedbackIcon' => [
        'default' => 'envelope',
        'success' => 'ok',
        'error' => 'exclamation-sign',
        'defaultOptions' => ['class'=>'text-primary']
    ]
])->textInput(['placeholder'=>'Enter a valid email address...']);

// Prepend an addon text
echo $form->field($model, 'email', ['addon' => ['prepend' => ['content'=>'@']]]);

// Append an addon text
echo $form->field($model, 'amount_paid', [
    'addon' => ['append' => ['content'=>'.00']]
]);

// Formatted addons (like icons)
echo $form->field($model, 'phone', [
    'addon' => [
        'prepend' => [
            'content' => ''
        ]
    ]
]);

// Formatted addons (inputs)
echo $form->field($model, 'phone', [
    'addon' => [
        'prepend' => [
            'content' => ''
        ]
    ]
]);

// Formatted addons (buttons)
echo $form->field($model, 'phone', [
    'addon' => [
        'prepend' => [
            'content' => Html::button('Go', ['class'=>'btn btn-primary']),
            'asButton' => true
        ]
    ]
]);
```

License
-------

[](#license)

**yii2-widget-activeform** is released under the BSD-3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity60

Solid adoption and visibility

Community38

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 91.8% 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 ~113 days

Recently: every ~174 days

Total

29

Last Release

1022d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3592619?v=4)[Kartik Visweswaran](/maintainers/kartik-v)[@kartik-v](https://github.com/kartik-v)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (146 commits)")[![YasserHassan](https://avatars.githubusercontent.com/u/9349772?v=4)](https://github.com/YasserHassan "YasserHassan (2 commits)")[![dmytroraschepkin](https://avatars.githubusercontent.com/u/7814293?v=4)](https://github.com/dmytroraschepkin "dmytroraschepkin (1 commits)")[![evgen-d](https://avatars.githubusercontent.com/u/2807102?v=4)](https://github.com/evgen-d "evgen-d (1 commits)")[![fredyns](https://avatars.githubusercontent.com/u/4033019?v=4)](https://github.com/fredyns "fredyns (1 commits)")[![freezy-sk](https://avatars.githubusercontent.com/u/661637?v=4)](https://github.com/freezy-sk "freezy-sk (1 commits)")[![arturszulc](https://avatars.githubusercontent.com/u/10119553?v=4)](https://github.com/arturszulc "arturszulc (1 commits)")[![mikspark](https://avatars.githubusercontent.com/u/1117977?v=4)](https://github.com/mikspark "mikspark (1 commits)")[![nbogol](https://avatars.githubusercontent.com/u/2125591?v=4)](https://github.com/nbogol "nbogol (1 commits)")[![SamMousa](https://avatars.githubusercontent.com/u/547021?v=4)](https://github.com/SamMousa "SamMousa (1 commits)")[![thiagotalma](https://avatars.githubusercontent.com/u/612578?v=4)](https://github.com/thiagotalma "thiagotalma (1 commits)")[![itzen](https://avatars.githubusercontent.com/u/8614041?v=4)](https://github.com/itzen "itzen (1 commits)")[![derekisbusy](https://avatars.githubusercontent.com/u/5118781?v=4)](https://github.com/derekisbusy "derekisbusy (1 commits)")

---

Tags

activefieldactiveformphpyii2-widgetsyii2extensionwidgetformfieldactiveformactivefield

### Embed Badge

![Health badge](/badges/kartik-v-yii2-widget-activeform/health.svg)

```
[![Health](https://phpackages.com/badges/kartik-v-yii2-widget-activeform/health.svg)](https://phpackages.com/packages/kartik-v-yii2-widget-activeform)
```

###  Alternatives

[kartik-v/yii2-widget-select2

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

3279.7M191](/packages/kartik-v-yii2-widget-select2)[kartik-v/yii2-detail-view

Enhanced Yii 2 Detail View widget with special Bootstrap styles, ability to edit data, and more.

701.1M41](/packages/kartik-v-yii2-detail-view)[kartik-v/yii2-widget-colorinput

An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)

324.8M10](/packages/kartik-v-yii2-widget-colorinput)[kartik-v/yii2-number

Number control and format mask input for Yii2 Framework.

22498.3k12](/packages/kartik-v-yii2-number)

PHPackages © 2026

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