et-soft/yii2-widget-select-year Widget for Yii2, created selectbox field with years

extensionwidgetform

yii2-widget-select-year

Latest Stable Version License Total Downloads Monthly Downloads Daily Downloads

Widget for Yii2, created selectbox field with 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.

Examples

Show selectbox with values from 2015 (current year) to 1995 year (-20 years from current year):

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

Show selectbox with values from 2005 (current year - 10 years) to 2025 year (+ 10 years from current year):

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

Show selectbox with fix values from 2000 to 2010 year:

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

Show selectbox with values from 2000 to current year:

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

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



1.0.0 is the latest of one release



BSD 3-Clause license
Stats
1 github stars & 0 github forks
12 downloads in the last day
113 downloads in the last 30 days
10104 total downloads