PHP code example of kartik-v / yii2-widget-switchinput
1. Go to this page and download the library: Download kartik-v/yii2-widget-switchinput library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kartik-v / yii2-widget-switchinput example snippets
use kartik\switchinput\SwitchInput;
// Usage with ActiveForm and model
echo $form->field($model, 'status')->widget(SwitchInput::classname(), [
'type' => SwitchInput::CHECKBOX
]);
// With model & without ActiveForm
echo SwitchInput::widget([
'name' => 'status_1',
'type' => SwitchInput::RADIO
]);
$ php composer.phar