PHP Class TbToggleButton

Inheritance: extends CInputWidget
Show file Open project: yinhe/yincart

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
$form when created via TbActiveForm, this attribute is set to the form that renders the widget
$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'=>'TbToggleColumn',
    'onChange'=>'js:function($el, status, e){ console.log($el, status, e); }',
 ),
$transitionSpeed the transition speed (toggle movement)
$width the width of the toggle button

Public Methods

Method Description
run ( ) Widget's run function

Protected Methods

Method Description
getConfiguration ( ) : array
registerClientScript ( integer $id ) Registers required css and js files

Method Details

getConfiguration() protected method

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

registerClientScript() protected method

Registers required css and js files
protected registerClientScript ( integer $id )
$id integer the id of the toggle button

run() public method

Widget's run function
public run ( )

Property Details

$animated public property

whether to use animation or not
public $animated

$customDisabledStyle public property

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

$customEnabledStyle public property

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

$disabledLabel public property

the label to display on the disabled side
public $disabledLabel

$disabledStyle public property

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

$enabledLabel public property

the label to display on the enabled side
public $enabledLabel

$enabledStyle public property

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

$form public property

when created via TbActiveForm, this attribute is set to the form that renders the widget
public $form

$height public property

the height of the toggle button
public $height

$onChange public 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'=>'TbToggleColumn',
    'onChange'=>'js:function($el, status, e){ console.log($el, status, e); }',
 ),
public $onChange

$transitionSpeed public property

the transition speed (toggle movement)
public $transitionSpeed

$width public property

the width of the toggle button
public $width