Skip to content

ahmadasjad/yii2-widgets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii2-widgets

Plus-Minus-Input

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

About

An extension for yii2 to decorate input with increase and decrease button

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages