定制 et-soft/yii2-widget-select-year 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

et-soft/yii2-widget-select-year

最新稳定版本:1.0.0

Composer 安装命令:

composer require et-soft/yii2-widget-select-year

包简介

Widget for Yii2, created selectbox field with years

README 文档

README

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, ]); ?>

统计信息

  • 总下载量: 14.32k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 8
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: BSD
  • 更新时间: 2026-01-04