<commit_before># yii2-widget-select-year

[![Latest Stable Version](https://poser.pugx.org/et-soft/yii2-widget-select-year/v/stable)](https://packagist.org/packages/et-soft/yii2-widget-select-year)
[![License](https://poser.pugx.org/et-soft/yii2-widget-select-year/license)](https://packagist.org/packages/et-soft/yii2-widget-select-year)
[![Total Downloads](https://poser.pugx.org/et-soft/yii2-widget-select-year/downloads)](https://packagist.org/packages/et-soft/yii2-widget-select-year)
[![Monthly Downloads](https://poser.pugx.org/et-soft/yii2-widget-select-year/d/monthly)](https://packagist.org/packages/et-soft/yii2-widget-select-year)
[![Daily Downloads](https://poser.pugx.org/et-soft/yii2-widget-select-year/d/daily)](https://packagist.org/packages/et-soft/yii2-widget-select-year)

Widget for Yii2, created selectbox field with years.

For example,

```php
<?php echo $form->field($model, 'year')->widget(etsoft\widgets\YearSelectbox::classname(), [
    'yearStart' => 0,
    'yearEnd' => -20,
 ]);
?>
```

shows selectbox with values from 2015 (current year) to 1995 year.

### Install

Either run

```
$ php composer.phar require et-soft/yii2-widget-select-year "*"
```

or add

```
"et-soft/yii2-widget-select-year": "*"
```

to the ```require``` section of your `composer.json` file.
<commit_msg>Update examples in docs.<commit_after># yii2-widget-select-year

[![Latest Stable Version](https://poser.pugx.org/et-soft/yii2-widget-select-year/v/stable)](https://packagist.org/packages/et-soft/yii2-widget-select-year)
[![License](https://poser.pugx.org/et-soft/yii2-widget-select-year/license)](https://packagist.org/packages/et-soft/yii2-widget-select-year)
[![Total Downloads](https://poser.pugx.org/et-soft/yii2-widget-select-year/downloads)](https://packagist.org/packages/et-soft/yii2-widget-select-year)
[![Monthly Downloads](https://poser.pugx.org/et-soft/yii2-widget-select-year/d/monthly)](https://packagist.org/packages/et-soft/yii2-widget-select-year)
[![Daily Downloads](https://poser.pugx.org/et-soft/yii2-widget-select-year/d/daily)](https://packagist.org/packages/et-soft/yii2-widget-select-year)

Widget for Yii2, created selectbox field with years.

For example,

```php
<?php echo $form->field($model, 'year')->widget(etsoft\widgets\YearSelectbox::classname(), [
    'yearStart' => 0,
    'yearEnd' => -20,
 ]);
?>
```

shows selectbox with values from 2015 (current year) to 1995 year.

```php
<?php echo $form->field($model, 'year')->widget(etsoft\widgets\YearSelectbox::classname(), [
    'yearStart' => -10,
    'yearEnd' => 10,
 ]);
?>
```

shows selectbox with values from 2005 (current year - 10 years) to 2025 year (+ 10 years from current year).

```php
<?php echo $form->field($model, 'year')->widget(etsoft\widgets\YearSelectbox::classname(), [
    'yearStart' => 2000,
    'yearStartType' => 'fix',
    'yearEnd' => 2010,
    'yearEndType' => 'fix',
 ]);
?>
```

shows selectbox with fix values from 2000 to 2010 years.

### Install

Either run

```
$ php composer.phar require et-soft/yii2-widget-select-year "*"
```

or add

```
"et-soft/yii2-widget-select-year": "*"
```

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

{'fraction_non_alphanumeric': 0.20201384518565135, 'fraction_numerical': 0.025802391441157962, 'mean_word_length': 4.646536412078153, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 25, 'https://': 20, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7071254', 'n_tokens_mistral': 1261, 'n_tokens_neox': 1171, 'n_words': 173}