ahmadasjad / yii2-widgets
An extension for input with facility to increase and decrease the value with the button
Installs: 195
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
pkg:composer/ahmadasjad/yii2-widgets
Requires
- yiisoft/yii2: ~2.0
- yiisoft/yii2-bootstrap: ~2.0
- yiisoft/yii2-bootstrap4: ~2.0
This package is auto-updated.
Last update: 2025-10-22 01:57:17 UTC
README
Installation
composer require ahmadasjad/yii2-widgets
Usage Example
<?php echo \ahmadasjad\yii2Widgets\PlusMinusInput::widget([ 'name' => 'name_test', 'plugin_options' => ['parser'=>'parseFloat', 'step'=>0.5] ]); ?>
Options to customize the plugin in plugin_options param:
[
'val_min' => 0,
'val_max' => 1000,
'step' => 1,
'parser' => 'parseInt',
'container' => ['class' => 'input-group', 'id' => 'your-custom-id-container'],
'plus' => ['id' => 'your-custom-id-plus', 'class' => 'btn btn-success', 'label' => '+',],
'minus' => ['id' => 'your-custom-id-minus', 'class' => 'btn btn-danger', 'label' => '-',],
]
val_min Minimum value allowed for input
val_max Maximum value allowed for input
step How much value to be increased/decreased on press of plus/minus button
parser Javascript function to parse the input data. For example parseInt, parseFloat, etc.
plus configuration for plus button
minus configuration for plus button
