PHPackages                             hgh/yii-advance-input - 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. hgh/yii-advance-input

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

hgh/yii-advance-input
=====================

Using this library, You can add widgets which have, on/off button, label, description, icon and unit.

1.0.3(6y ago)121MITPHP

Since Jul 10Pushed 6y agoCompare

[ Source](https://github.com/H-Gh/yii-advance-input)[ Packagist](https://packagist.org/packages/hgh/yii-advance-input)[ Docs](https://github.com/H-Gh/yii-advance-input)[ RSS](/packages/hgh-yii-advance-input/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (3)Versions (3)Used By (0)

Yii advance input
=================

[](#yii-advance-input)

Using this library, You can add widgets which have, on/off button, label, description, icon and unit.

[![help](https://camo.githubusercontent.com/474791f84b3cb1f62de489220813c5c4e94ecac99b2d96b8a28da92c7881c974/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6b6d30713472673535396e356e7a392f68656c702e6a70673f646c3d30)](https://camo.githubusercontent.com/474791f84b3cb1f62de489220813c5c4e94ecac99b2d96b8a28da92c7881c974/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6b6d30713472673535396e356e7a392f68656c702e6a70673f646c3d30)

[![MIT](https://camo.githubusercontent.com/46925f21d8effabf6a029124636075adf99640f4c2b27fc638fe9ca15d387905/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f482d47682f7969692d616476616e63652d696e7075742e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/46925f21d8effabf6a029124636075adf99640f4c2b27fc638fe9ca15d387905/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f482d47682f7969692d616476616e63652d696e7075742e7376673f7374796c653d666c61742d737175617265) [![Version](https://camo.githubusercontent.com/f071560e7597d872764b22571c6bab858c605bfd2864630ed26e2c99c2d5eb21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6867682f7969692d616476616e63652d696e7075742e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/f071560e7597d872764b22571c6bab858c605bfd2864630ed26e2c99c2d5eb21/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6867682f7969692d616476616e63652d696e7075742e7376673f7374796c653d666c61742d737175617265) [![Code size](https://camo.githubusercontent.com/6f17b6c3bece8aba9815ecaefd0207b0e9b03cfd221098691bdbd85e0f72d915/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f482d67682f7969692d616476616e63652d696e7075742e7376673f636f6c6f723d726564267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/6f17b6c3bece8aba9815ecaefd0207b0e9b03cfd221098691bdbd85e0f72d915/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f636f64652d73697a652f482d67682f7969692d616476616e63652d696e7075742e7376673f636f6c6f723d726564267374796c653d666c61742d737175617265)

Usage
-----

[](#usage)

```
composer require hgh/yii-advance-input

```

Widgets
-------

[](#widgets)

There are 4 widget. There are common and specific options that widgets can use them that we will see them in future.

- [Text](#text)
- [Checkbox](#checkbox)
- [Dropdown](#dropdown)
- [Textarea](#textarea)

Text
----

[](#text)

This widget will provide a `HTML` `input` tag with `type` of `text`.

#### usage

[](#usage-1)

```

```

Checkbox
--------

[](#checkbox)

This widget will provide a `HTML` `input` tag with `type` of `checkbox`.

```

```

Dropdown
--------

[](#dropdown)

This widget will provide a `HTML` `select` tag.
This widget needs another required option which is called `items`. The `items` array is a map for `select` `datalist`. In another word, `key` of `array` elements will be `value` of `option` tag and `value` of `array` elements will be `option` tag `value`. See bellow:

```

```

will produce:

```

    value1
    value2

```

Textarea
--------

[](#textarea)

This widget will provide a `HTML` `textarea` tag.

```

```

General options list
--------------------

[](#general-options-list)

Main common options that all widgets can use is listed below.

- [name](#name)
- [icon](#icon)
- [unit](#unit)
- [checkbox](#checkbox)
- [label](#label)
- [description](#description)
- [wrapperOptions](#wrapper-options)
- [inputOptions](#input-options)
- [checkboxOptions](#checkbox-options)
- [model and form](#model-and-form)
- [rtl](#rtl)

Dropdown options
----------------

[](#dropdown-options)

- [items](#items)

Options
-------

[](#options)

### name

[](#name)

The main name of input which will place into *`name`* attribute of input.

###### PHP

[](#php)

```

```

###### Preview

[](#preview)

[![Just input](https://camo.githubusercontent.com/85ec73557d75727c6048c8884daf57ecd2ad8c7a6256db3573a6ed9b8d07d5e1/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f3276626b78357634347036313771692f6a7573742d696e7075742e6a7067)](https://camo.githubusercontent.com/85ec73557d75727c6048c8884daf57ecd2ad8c7a6256db3573a6ed9b8d07d5e1/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f3276626b78357634347036313771692f6a7573742d696e7075742e6a7067)

---

### icon

[](#icon)

optional
The icon class which will appear in a box right before input. This is a *`class`* attribute which will add to a *`i`* element.

##### PHP

[](#php-1)

```

```

##### Preview

[](#preview-1)

[![Input with icon](https://camo.githubusercontent.com/688515eab3c3a3aa11e833f85bf72c8e93091226c41377b890da9186e3efb0a8/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f726c3673356e33783077326d6463352f696e7075742d776974682d69636f6e2e6a7067)](https://camo.githubusercontent.com/688515eab3c3a3aa11e833f85bf72c8e93091226c41377b890da9186e3efb0a8/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f726c3673356e33783077326d6463352f696e7075742d776974682d69636f6e2e6a7067)

---

### unit

[](#unit)

Every input will accept specific values. Using this option, a unit box will append to input.

##### PHP

[](#php-2)

```

```

##### Preview

[](#preview-2)

[![with unit](https://camo.githubusercontent.com/04c5af5b2244722896e5f26d06b8a98f84dff603a8cb01067dbbd1b5f931344a/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f706b636e6373693466366f306a61722f776974682d756e69742e6a7067)](https://camo.githubusercontent.com/04c5af5b2244722896e5f26d06b8a98f84dff603a8cb01067dbbd1b5f931344a/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f706b636e6373693466366f306a61722f776974682d756e69742e6a7067)

---

### checkbox

[](#checkbox-1)

Using this option, you provide an option which allows users to not filling input. If checkbox is not checked, an `disabled` attribute will add to `input`.

***Notice***
`unit` options will not work on this type of widget.

##### PHP

[](#php-3)

```

```

##### Preview

[](#preview-3)

[![with checkbox](https://camo.githubusercontent.com/88fba23c193f292aacf6be605b0c1399731cea84f931b82503931aa565c1b54a/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f646f6f6d67336533397339667a63692f776974682d636865636b626f782e6a7067)](https://camo.githubusercontent.com/88fba23c193f292aacf6be605b0c1399731cea84f931b82503931aa565c1b54a/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f646f6f6d67336533397339667a63692f776974682d636865636b626f782e6a7067)

---

### label

[](#label)

A label for input.

##### PHP

[](#php-4)

```

```

##### Preview

[](#preview-4)

[![with label](https://camo.githubusercontent.com/0cc3da93ab544b0acd7e4d3e0a78fa272a3b69004168e0c84b920538cba002c1/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f706e36396171323662786f61676a712f776974682d6c6162656c2e6a7067)](https://camo.githubusercontent.com/0cc3da93ab544b0acd7e4d3e0a78fa272a3b69004168e0c84b920538cba002c1/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f706e36396171323662786f61676a712f776974682d6c6162656c2e6a7067)

---

### description

[](#description)

If you want to describe what the field is for, you can use this option. Using this option, an `div` will add after label.

##### PHP

[](#php-5)

```

```

##### Preview

[](#preview-5)

[![with description](https://camo.githubusercontent.com/b5356e37219864c454f428ce6a3e3f86529a7bb9623ae5097fb88ba2c981843b/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f63376c623163656976777a673330382f776974682d6465736372697074696f6e2e6a7067)](https://camo.githubusercontent.com/b5356e37219864c454f428ce6a3e3f86529a7bb9623ae5097fb88ba2c981843b/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f63376c623163656976777a673330382f776974682d6465736372697074696f6e2e6a7067)

---

### wrapperOptions

[](#wrapperoptions)

A map of attributes and their values for wrapper.

##### PHP

[](#php-6)

```

```

##### Preview

[](#preview-6)

[![with wrapperOptions](https://camo.githubusercontent.com/e5a91e73dd74116d0fd0fb629c4add2fa12884569efaadcfb304e6018b106f42/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6f36643077387936637475747869302f776974682d777261707065722d6f7074696f6e2e6a7067)](https://camo.githubusercontent.com/e5a91e73dd74116d0fd0fb629c4add2fa12884569efaadcfb304e6018b106f42/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6f36643077387936637475747869302f776974682d777261707065722d6f7074696f6e2e6a7067)

---

### inputOptions

[](#inputoptions)

A map of attributes and their values for input.

##### PHP

[](#php-7)

```

```

##### Preview

[](#preview-7)

[![with inputOptions](https://camo.githubusercontent.com/d5b33a942cb4b1ed1b333f7ada4a11201795c5f24e2eac7ec8d2c03ed0626cdd/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f72786b3466636d7834726b71316e372f776974682d696e7075742d6f7074696f6e732e6a7067)](https://camo.githubusercontent.com/d5b33a942cb4b1ed1b333f7ada4a11201795c5f24e2eac7ec8d2c03ed0626cdd/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f72786b3466636d7834726b71316e372f776974682d696e7075742d6f7074696f6e732e6a7067)

---

### checkboxOptions

[](#checkboxoptions)

A map of attributes and their values for checkbox input.

***Notice***
Checkbox use bootstrap toggle. All options of **Bootstrap Toggle** is supported. Visit [Bootstrap Toggle](http://www.bootstraptoggle.com/).

##### PHP

[](#php-8)

```

```

##### Preview

[](#preview-8)

[![with checkboxOptions](https://camo.githubusercontent.com/6cec4ded11a4a8336b1809f1d3eeb245cfcca9fa5166bfec1f08ac84d4842ef3/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f7276786877696a716b6764673866312f776974682d636865636b626f784f7074696f6e732e6a7067)](https://camo.githubusercontent.com/6cec4ded11a4a8336b1809f1d3eeb245cfcca9fa5166bfec1f08ac84d4842ef3/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f7276786877696a716b6764673866312f776974682d636865636b626f784f7074696f6e732e6a7067)

---

### model and form

[](#model-and-form)

These widgets can also receive `Yii2` `models`. By passing your `model` into this option, elements will generate using `form` option that you provided. `form` option must be an instance of `ActiveForm` of `Yii2`. For more information visit: [ActiveForm](https://www.yiiframework.com/doc/api/2.0/yii-widgets-activeform)

***Notice***By using `model` option, `label` will generate automatically. It use `attributeLabel` of `property` of `model`. If there is no label, label box will not generate. Also to prevent of label generation even if `attributeLabel` in model exists, set `label` option to `false`.

##### PHP

[](#php-9)

```

```

##### Preview

[](#preview-9)

[![With model](https://camo.githubusercontent.com/73c65a6820c3be2a35e87dff7925767e52e4dbaffa0231f294094c20acdd0e58/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6236347a6c776f356a756576356c382f776974682d6d6f64656c2e6a7067)](https://camo.githubusercontent.com/73c65a6820c3be2a35e87dff7925767e52e4dbaffa0231f294094c20acdd0e58/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6236347a6c776f356a756576356c382f776974682d6d6f64656c2e6a7067)

---

### rtl

[](#rtl)

This widgets, also support `rtl` pages. To use these as a `rtl` `widget`, just set `rtl` option `true`;

##### PHP

[](#php-10)

```

```

##### Preview

[](#preview-10)

[![With model](https://camo.githubusercontent.com/73c65a6820c3be2a35e87dff7925767e52e4dbaffa0231f294094c20acdd0e58/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6236347a6c776f356a756576356c382f776974682d6d6f64656c2e6a7067)](https://camo.githubusercontent.com/73c65a6820c3be2a35e87dff7925767e52e4dbaffa0231f294094c20acdd0e58/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6236347a6c776f356a756576356c382f776974682d6d6f64656c2e6a7067)

---

### items

[](#items)

The `items` array is a map for `select` `datalist`. In another word, `key` of `array` elements will be `value` of `option` tag and `value` of `array` elements will be `option` tag `value`

***Notice***
Checkbox use bootstrap toggle. All options of **Bootstrap Toggle** is supported. Visit [Bootstrap Toggle](http://www.bootstraptoggle.com/).

##### PHP

[](#php-11)

```

```

##### Preview

[](#preview-11)

[![Right to left](https://camo.githubusercontent.com/d3aabf62c7f27e9ebb52edb888624952f4cc72ac4c11851e4e88aacb4c7ed67b/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6c7962727a68316f653439636338312f776974682d72746c2e6a7067)](https://camo.githubusercontent.com/d3aabf62c7f27e9ebb52edb888624952f4cc72ac4c11851e4e88aacb4c7ed67b/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f732f6c7962727a68316f653439636338312f776974682d72746c2e6a7067)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

2

Last Release

2498d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7873222f18ced9739dd54f5bcfa13a8d9738496d22b38ff35d9f4b5b84f3269b?d=identicon)[h.gh](/maintainers/h.gh)

---

Top Contributors

[![H-Gh](https://avatars.githubusercontent.com/u/32479577?v=4)](https://github.com/H-Gh "H-Gh (10 commits)")

---

Tags

jqueryphpyii2yii2-frameworkyii2-widgetsphpjavascriptjqueryyii2

### Embed Badge

![Health badge](/badges/hgh-yii-advance-input/health.svg)

```
[![Health](https://phpackages.com/badges/hgh-yii-advance-input/health.svg)](https://phpackages.com/packages/hgh-yii-advance-input)
```

###  Alternatives

[fedemotta/yii2-widget-datatables

DataTables widget for Yii2

34179.4k1](/packages/fedemotta-yii2-widget-datatables)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1357.2k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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