프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$attribute | the model attribute that this widget is associated with. | ||
$checked | the control for setting the "checked" attribute in the input tag. | ||
$encodeOffText | whether the off text should be HTML-encoded. | ||
$encodeOnText | whether the on text should be HTML-encoded. | ||
$inputOptions | the HTML attributes for the underlying input tag. | ||
$model | the data model that this widget is associated with. | ||
$name | the input name. This must be set if [[model]] and [[attribute]] are not set. | ||
$offIcon | the options for the optional off icon. To specify an icon you can use the following parameters: php [ 'name' => 'name of the icon', // required 'position' => 'position of the icon', // optional, 'left' or 'right', defaults to 'left' 'options' => 'the HTML attributes for the img', // optional ] | ||
$offText | the text displaying the unchecked status. This can be used in conjunction with the [[offIcon]]. | ||
$onIcon | the options for the optional on icon. To specify an icon you can use the following parameters: php [ 'name' => 'name of the icon', // required 'position' => 'position of the icon', // optional, 'left' or 'right', defaults to 'left' 'options' => 'the HTML attributes for the img', // optional ] | ||
$onText | the text displaying the checked status. This can be used in conjunction with the [[onIcon]]. | ||
$options | the HTML attributes for the widget container tag. The following special options are recognized: - tag: string, defaults to "div", the name of the container tag. | ||
$uncheck | the value associated with the uncheck state of the radio button. If not set, it will take the default value '0'. This method will render a hidden input so that if the radio button is not checked and is submitted, the value of this attribute will still be submitted to the server via the hidden input. If you do not want any hidden input, you should explicitly set this option as null. | ||
$value | the input value. If not set, it will take the default value "1". |
메소드 | 설명 | |
---|---|---|
init ( ) | Initialize the widget. | |
run ( ) : string | Executes the widget. |
메소드 | 설명 | |
---|---|---|
renderIcon ( string $state ) : string | Renders an icon. | |
renderLabel ( string $state ) : string | Renders the HTML markup for the on/off label. | |
renderSwitch ( ) : string | Render the switch button checkbox. |
protected renderIcon ( string $state ) : string | ||
$state | string | the name of the icon property. |
리턴 | string | the rendered icon |
protected renderLabel ( string $state ) : string | ||
$state | string | the state to used. Use "off" or "on". |
리턴 | string | the rendered label. |
protected renderSwitch ( ) : string | ||
리턴 | string |
public $checked |
public $name |
public $offIcon |
public $offText |
public $onIcon |
public $onText |
public $options |
public $uncheck |