PHP code example of drexlerux / yii2-lcswitch

1. Go to this page and download the library: Download drexlerux/yii2-lcswitch 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/ */

    

drexlerux / yii2-lcswitch example snippets


  use drexlerux\lcswitch\LcSwitch;
  

  <?= $form->field($model, 'attribute')->widget(LcSwitch::classname(), [
      'options'=>[
          'on_text' => Yii::t('app', 'Yes'), // Default value
          'of_text' => Yii::t('app', 'No'), // Default value
          'width' => '100px'
      ],
      'events' => [
          'lcs-init' => "function(input){}"
          'lcs-statuschange' => 'function(){}',
          'lcs-on' => 'function(){}',
          'lcs-off' => 'function(){}',
      ]
  ]); 

php composer.phar