PHP Class WhToggleButton

Author: Antonio Ramirez ([email protected])
Inheritance: extends CInputWidget
ファイルを表示 Open project: 2amigos/yiiwheels

Public Properties

Property Type Description
$animated whether to use animation or not
$customDisabledStyle a custom style for the disabled option. Format
 ...
 'customDisabledStyle'=>array(
     'background'=>'#FF00FF',
     'gradient'=>'#D300D3',
     'color'=>'#FFFFFF'
 ),
 ...
$customEnabledStyle a custom style for the enabled option. Format
 ...
 'customEnabledStyle'=>array(
     'background'=>'#FF00FF',
     'gradient'=>'#D300D3',
     'color'=>'#FFFFFF'
 ),
 ...
$disabledLabel the label to display on the disabled side
$disabledStyle the style of the toggle button disabled style Accepted values ["primary", "danger", "info", "success", "warning"] or nothing
$enabledLabel the label to display on the enabled side
$enabledStyle the style of the toggle button enable style Accepted values ["primary", "danger", "info", "success", "warning"] or nothing
$height the height of the toggle button
$onChange the javascript function The function signature is function($el, status, e)
  • $el the toggle element changed.
  • status the status of the element (true=on | false=off)
  • e the event object
Example:
 array(
    class'=>'WhToggleColumn',
    'onChange'=>'js:function($el, status, e){ console.log($el, status, e); }',
 ),
$tagName the tag name. Defaults to 'div'.
$transitionSpeed the transition speed (toggle movement)
$width the width of the toggle button

Public Methods

Method Description
init ( ) Widget's initialization method
renderField ( ) Renders the input field
run ( ) Widget's run function

Protected Methods

Method Description
getConfiguration ( ) : array
registerClientScript ( ) Registers client scripts

Method Details

getConfiguration() protected method

protected getConfiguration ( ) : array
return array the configuration of the plugin

init() public method

Widget's initialization method
public init ( )

registerClientScript() protected method

Registers client scripts
protected registerClientScript ( )

renderField() public method

Renders the input field
public renderField ( )

run() public method

Widget's run function
public run ( )

Property Details

$animated public_oe property

whether to use animation or not
public $animated

$customDisabledStyle public_oe property

a custom style for the disabled option. Format
 ...
 'customDisabledStyle'=>array(
     'background'=>'#FF00FF',
     'gradient'=>'#D300D3',
     'color'=>'#FFFFFF'
 ),
 ...
public $customDisabledStyle

$customEnabledStyle public_oe property

a custom style for the enabled option. Format
 ...
 'customEnabledStyle'=>array(
     'background'=>'#FF00FF',
     'gradient'=>'#D300D3',
     'color'=>'#FFFFFF'
 ),
 ...
public $customEnabledStyle

$disabledLabel public_oe property

the label to display on the disabled side
public $disabledLabel

$disabledStyle public_oe property

the style of the toggle button disabled style Accepted values ["primary", "danger", "info", "success", "warning"] or nothing
public $disabledStyle

$enabledLabel public_oe property

the label to display on the enabled side
public $enabledLabel

$enabledStyle public_oe property

the style of the toggle button enable style Accepted values ["primary", "danger", "info", "success", "warning"] or nothing
public $enabledStyle

$height public_oe property

the height of the toggle button
public $height

$onChange public_oe property

the javascript function The function signature is function($el, status, e)
  • $el the toggle element changed.
  • status the status of the element (true=on | false=off)
  • e the event object
Example:
 array(
    class'=>'WhToggleColumn',
    'onChange'=>'js:function($el, status, e){ console.log($el, status, e); }',
 ),
public $onChange

$tagName public_oe property

the tag name. Defaults to 'div'.
public $tagName

$transitionSpeed public_oe property

the transition speed (toggle movement)
public $transitionSpeed

$width public_oe property

the width of the toggle button
public $width