PHP Class WhSwitch

See also: https://github.com/nostalgiaz/bootstrap-switch
Author: Antonio Ramirez ([email protected])
Inheritance: extends CInputWidget
Show file Open project: 2amigos/yiiwheels

Public Properties

Property Type Description
$animated whether the slide is animated or not.
$debugMode whether to display minified versions of the files or not
$events the JavaScript event handlers.
$inputType input type. It can be 'radio' or 'checkbox'
$offColor color when is off. It can be any of bootstrap button states. Defaults to 'warning'.
$offLabel the label when is off. Defaults to 'Off'.
$onColor color when is on. It can be any of bootstrap button states. Defaults to 'primary'.
$onLabel the label when is on. Defaults to 'On'.
$size size of switch button. Supports 'large', 'small' or 'mini'
$textLabel the text label. Defaults to null.

Protected Properties

Property Type Description
$pluginOptions the switch plugin options.

Public Methods

Method Description
init ( ) Initializes the widget.
registerClientScript ( ) Registers required client script for bootstrap typeahead. It is not used through bootstrap->registerPlugin in order to attach events if any
renderField ( ) Renders the typeahead field
run ( ) Runs the widget.

Method Details

init() public method

Initializes the widget.
public init ( )

registerClientScript() public method

Registers required client script for bootstrap typeahead. It is not used through bootstrap->registerPlugin in order to attach events if any

renderField() public method

Renders the typeahead field
public renderField ( )

run() public method

Runs the widget.
public run ( )

Property Details

$animated public property

whether the slide is animated or not.
public $animated

$debugMode public property

whether to display minified versions of the files or not
public $debugMode

$events public property

the JavaScript event handlers.
public $events

$inputType public property

input type. It can be 'radio' or 'checkbox'
public $inputType

$offColor public property

color when is off. It can be any of bootstrap button states. Defaults to 'warning'.
public $offColor

$offLabel public property

the label when is off. Defaults to 'Off'.
public $offLabel

$onColor public property

color when is on. It can be any of bootstrap button states. Defaults to 'primary'.
public $onColor

$onLabel public property

the label when is on. Defaults to 'On'.
public $onLabel

$pluginOptions protected property

the switch plugin options.
protected $pluginOptions

$size public property

size of switch button. Supports 'large', 'small' or 'mini'
public $size

$textLabel public property

the text label. Defaults to null.
public $textLabel