PHPackages                             kartik-v/yii2-field-range - 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. kartik-v/yii2-field-range

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

kartik-v/yii2-field-range
=========================

Easily manage Yii 2 ActiveField ranges (from/to) with Bootstrap 3 addons markup and more

v1.3.5(6y ago)232.1M↓11.4%920BSD-3-ClausePHP

Since Jul 14Pushed 6y ago3 watchersCompare

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

READMEChangelog (9)Dependencies (2)Versions (14)Used By (20)

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

 [ ![Donate](https://camo.githubusercontent.com/4af77d425ca202e55ab3d711b438e238ded194735bc345a019ac060e03e26227/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67) ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal")
====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-field-range--------------------)

[![Stable Version](https://camo.githubusercontent.com/c8c8776a78a95fe11b9b77b91e08c4d20b566c6cbe6f8e4808bbc3e5a621a289/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6669656c642d72616e67652f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-field-range)[![Unstable Version](https://camo.githubusercontent.com/4d2a47133351b1dc710d6dc48bb5f4843df68b10c6a8109ce29b21ba122b8965/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6669656c642d72616e67652f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-field-range)[![License](https://camo.githubusercontent.com/fb42ee60c3611ab2f897a6ea5302588234129b483beb867945ad6f4e729d5e49/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6669656c642d72616e67652f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-field-range)[![Total Downloads](https://camo.githubusercontent.com/dc76a70242ba19092efab11dda405cae76d069eac2044aa9a928cd04b7db7415/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6669656c642d72616e67652f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-field-range)[![Monthly Downloads](https://camo.githubusercontent.com/fd01dc9dab1b99ab19a91119d7277e3cd96863503cae852d9b210994c84fe918/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6669656c642d72616e67652f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-field-range)[![Daily Downloads](https://camo.githubusercontent.com/d7ddcec6a6bdb4b51cf01c2b5d231128a579d885f4f89ce4c841a3775a216660/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d6669656c642d72616e67652f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-field-range)

A Yii 2 extension that allows you to easily setup ActiveField range fields with Bootstrap 3 addons markup and more. This allows you to setup the attributes joined together like a single field with a bootstrap addon separating the two. In addition, it enables you to display the field validation error messages as one single block instead of separate validation errors for two fields.

> NOTE:

- The FieldRange validation routine displays only the first error encountered in validation of either of the attributes.
- To understand setting up your model validation rules for the attributes when using this extension, refer [this wiki](http://www.yiiframework.com/wiki/698/model-validation-for-field-ranges-using-yii2-field-range-extension/)

The key features supported by this widget extension are:

- display the two range fields as a single grouped block using Bootstrap 3 addons
- tweak yii active form validation to display validation errors as one single block instead of separate error blocks under each field. This allows you to style your field range inputs better for various form layouts. No more misalignment of adjacent fields due to yii validation error messages.
- ability to use any input from yii\\helpers or any widget class for rendering the from and to fields.
- enhanced usage with `\kartik\widgets\ActiveField` that allows you to add custom addons to prepend and append to your inputs.
- default support for all widgets under `\kartik\widgets`. Special enhanced support for `\kartik\widgets\DatePicker`to render date ranges.
- ability to use the kartik\\datecontrol\\DateControl widget which in turn can use any Date or Time widgets.

### Demo

[](#demo)

You can see detailed [documentation and demos](http://demos.krajee.com/field-range) on usage of the extension.

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

[](#release-changes)

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

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

[](#installation)

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

> Note: Check the [composer.json](https://github.com/kartik-v/yii2-field-range/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.

Either run

```
$ php composer.phar require kartik-v/yii2-field-range "dev-master"

```

or add

```
"kartik-v/yii2-field-range": "dev-master"

```

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

Usage
-----

[](#usage)

### FieldRange

[](#fieldrange)

```
use kartik\field\FieldRange;
use kartik\widgets\ActiveForm;
$form = ActiveForm::begin();
echo FieldRange::widget([
    'form' => $form,
    'model' => $model,
    'label' => 'Enter start and end points',
    'attribute1' => 'start_point',
    'attribute2' => 'end_point',
    'type' => FieldRange::INPUT_TEXT,
]);
ActiveForm::end();
```

License
-------

[](#license)

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

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 95.9% 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 ~148 days

Recently: every ~248 days

Total

13

Last Release

2551d 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 (47 commits)")[![mklemarczyk](https://avatars.githubusercontent.com/u/2727261?v=4)](https://github.com/mklemarczyk "mklemarczyk (1 commits)")[![Sadi01](https://avatars.githubusercontent.com/u/8774917?v=4)](https://github.com/Sadi01 "Sadi01 (1 commits)")

---

Tags

dateyii2extensionwidgetbootstraprangeaddontobootstrap 3field-rangefrombootstrap 4

### Embed Badge

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

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

###  Alternatives

[kartik-v/yii2-date-range

An advanced Yii 2 date range picker input for based on bootstrap-daterangepicker plugin.

894.4M42](/packages/kartik-v-yii2-date-range)[kartik-v/yii2-sortable

Create sortable lists and grids using HTML5 drag and drop API for Yii 2.0.

433.8M13](/packages/kartik-v-yii2-sortable)[kartik-v/yii2-money

An advanced money mask input for Yii 2.0 based on jquery maskmoney plugin styled for Bootstrap 3.

29915.4k10](/packages/kartik-v-yii2-money)[kartik-v/yii2-sortable-input

Sortable input widget based on yii2-sortable extension.

24660.4k2](/packages/kartik-v-yii2-sortable-input)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[kartik-v/yii2-slider

An advanced slider input for Yii Framework 2 for both touch enabled and desktop devices based on bootstrap-slider.

30784.4k4](/packages/kartik-v-yii2-slider)

PHPackages © 2026

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