2017 © Pedro Peláez
 

yii2-extension yii2-icomp-toggle

image

dbfernandes/yii2-icomp-toggle

  • Tuesday, December 12, 2017
  • by dbfernandes
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 125 % Grown

The README.md

yii2-bootstrap-toggle

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

Screenshot, (*2)

http://www.bootstraptoggle.com/, (*3)

Installation

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

Either run, (*5)

$ php composer.phar require dbfernandes/yii2-icomp-toggle dev-master

or add, (*6)

"dbfernandes/yii2-icomp-toggle": "dev-master"

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

Usage

In active form

use dbfernandes\icomp\ICompToggleWidget;

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

Standalone widget

use dbfernandes\icomp\ICompToggleWidget;

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

Options

ICompToggleWidget::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',

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

The Versions

12/12 2017

dev-master

9999999-dev

  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