coderius / yii2-toggle-switcher-widget
Yii 2 toggle-switcher-widget
Installs: 91
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- php: >=5.4.0
- yiisoft/yii2: ~2.0.10
Requires (Dev)
This package is auto-updated.
Last update: 2024-12-11 15:18:33 UTC
README
This widget will help to replace the checkbox in the form with a nice switch.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require "coderius/yii2-toggle-switcher-widget" "@dev"
or
composer require "coderius/yii2-toggle-switcher-widget" "@dev"
or add
"coderius/yii2-toggle-switcher-widget" : "@dev"
to the require section of your application's composer.json
file.
Usage
How to basic use widget:
<?php echo $form->field($model, 'flagActive')->widget(ToggleSwitchWidget::classname(), [ 'type' => ToggleSwitchWidget::CHECKBOX ]); ?>
Or more short notice (ToggleSwitchWidget::CHECKBOX is default type value in widget):
<?= $form->field($model, 'status')->widget(ToggleSwitchWidget::classname()); ?>