https://github.com/ahmadasjad/yii2-widgets
An extension for yii2 to decorate input with increase and decrease button
https://github.com/ahmadasjad/yii2-widgets
plus-minus-input yii2 yii2-widget
Last synced: about 2 months ago
JSON representation
An extension for yii2 to decorate input with increase and decrease button
- Host: GitHub
- URL: https://github.com/ahmadasjad/yii2-widgets
- Owner: ahmadasjad
- License: bsd-3-clause
- Created: 2020-04-13T22:25:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-21T13:35:41.000Z (about 5 years ago)
- Last Synced: 2025-02-09T22:30:38.483Z (3 months ago)
- Topics: plus-minus-input, yii2, yii2-widget
- Language: PHP
- Homepage: https://github.com/ahmadasjad/yii2-widgets
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yii2-widgets

###### Installation```
composer require ahmadasjad/yii2-widgets
```##### Usage Example
```php
'name_test',
'plugin_options' => ['parser'=>'parseFloat', 'step'=>0.5]
]);
?>
```**Options to customize the plugin in `plugin_options` param:**
```php
[
'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