ekilei / yii2-numstepper-widget
Input simular number
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: ^2.0.4
- yiisoft/yii2-bootstrap: *
This package is auto-updated.
Last update: 2024-09-29 05:22:01 UTC
README
Numstepper является надстройкой над InputWidget, предназначен для адаптивных сайтов, удобен в применении на декстопе и на мобильных устройствах.
Numstepper is an add-on above the InputWidget, designed for adaptive sites, convenient for use on the desktop and on mobile devices.
<?= $form->field($model,'day')->widget(\ekilei\numstepper\Numstepper::className()) ?>
?>
C параметрами
With parameters
<?= $form->field($model,'day')->widget(\ekilei\numstepper\Numstepper::className(),
[
'min' => -28,
'max' => 28,
])
?>
C исключением и значением при инициализации
With exception and initialization value
<?= $form->field($model,'day')->widget(\ekilei\numstepper\Numstepper::className(),
[
'min' => -28,
'max' => 28,
'exclude' => [0],
'default' => (int)$model->day ? (int)$model->day : 1,
])
?>
C подсказкой
With a hint
<?= $form->field($model,'day')->widget(\ekilei\numstepper\Numstepper::className(),
[
'min' => -28,
'max' => 28,
'exclude' => [0],
'default' => (int)$model->day ? (int)$model->day : 1,
])
->hint(Yii::t('app','Negative numbers make it possible to choose a day from the end of the month.').'
<br>'.Yii::t('app','Example').': "-1" = [31,30,28(29)], а "-3" = [29,28,26(27)] ')
?>
Со своими иконками кнопок
With own icon buttons
<?= $form->field($model,'day')->widget(\ekilei\numstepper\Numstepper::className(),
[
'default' => (int)$model->day ? (int)$model->day : 1,
'minusButton' => 'menu-down',
'plusButton' => 'menu-up',
])
?>
С изменением расположением кнопок
With the change in the arrangement of the buttons
<?= $form->field($model,'day')->widget(\ekilei\numstepper\Numstepper::className(),
[
'default' => (int)$model->day ? (int)$model->day : 1,
'minusButton' => 'menu-down',
'plusButton' => 'menu-up',
'prepend' => [],
'append' => ['{minus}','{plus}'],
])
?>
Установка
Install
composer require ekilei/yii2-numstepper-widget "dev-master"