2017 © Pedro Peláez
 

yii2-extension yii2-bootstrap-toggle

image

alexeevdv/yii2-bootstrap-toggle

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 5 % Grown

The README.md

yii2-bootstrap-toggle

Build Status codecov PHP 5.6 PHP 7.0 PHP 7.1 PHP 7.2, (*1)

Yii2 extension to render bootstrap toggle widget instead of checkbox., (*2)

Screenshot, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

$ php composer.phar require alexeevdv/yii2-bootstrap-toggle "~2.0"

or add, (*6)

"alexeevdv/yii2-bootstrap-toggle": "~2.0"

to the require section of your composer.json file., (*7)

Usage

In active form

use alexeevdv\yii\BootstrapToggleWidget;

//...
echo $form->field($model, 'attribute')->widget(BootstrapToggleWidget::class);
//...

Standalone widget

use alexeevdv\yii\BootstrapToggleWidget;

//...
BootstrapToggleWidget::widget([
    'name' => 'is_enabled',
    'value' => false,
]);
//...

Options

BootstrapToggleWidget::widget([
    /**
     * Wrapper tag name. If set to false no tag will be rendered
     */
    'container' => 'div',

    /**
     * Wrapper HTML attributes
     */
    'containerOptions' => [],

    /**
     * Label when checkbox is checked
     */
    'labelEnabled' => 'Yes',

    /**
     * Label when checkbox is not checked
     */
    'labelDisabled' => 'No',

    /**
     * Value when checkbox is checked
     */
    'valueEnabled' => '1',

    /**
     * Value when checkbox is not checked
     */
    'valueDisabled' => '0',     

     /**
      * Additional javascript options to Bootstrap Toggle plugin 
      */
     'pluginOptions' => [],
]);

The Versions

16/07 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

 

The Development Requires

16/07 2018

2.0.0

2.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires

24/03 2018

1.0.3

1.0.3.0

  Sources   Download

MIT

The Requires

 

The Development Requires

18/02 2018

1.0.2

1.0.2.0

  Sources   Download

MIT

The Requires

 

The Development Requires

14/07 2017

1.0.1

1.0.1.0

  Sources   Download

MIT

The Requires

 

The Development Requires

14/07 2017

1.0.0

1.0.0.0

  Sources   Download

MIT

The Requires

 

The Development Requires