PHP 클래스 macgyer\yii2materializecss\widgets\form\SwitchButton

저자: Christoph Erdmann ([email protected])
상속: extends macgyer\yii2materializecss\lib\BaseInputWidget
파일 보기 프로젝트 열기: macgyer/yii2-materializecss

공개 프로퍼티들

프로퍼티 타입 설명
$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.

메소드 상세

init() 공개 메소드

Initialize the widget.
public init ( )

renderIcon() 보호된 메소드

Renders an icon.
또한 보기: Icon::run
protected renderIcon ( string $state ) : string
$state string the name of the icon property.
리턴 string the rendered icon

renderLabel() 보호된 메소드

This method also renders the corresponding icons, if set.
protected renderLabel ( string $state ) : string
$state string the state to used. Use "off" or "on".
리턴 string the rendered label.

renderSwitch() 보호된 메소드

Render the switch button checkbox.
protected renderSwitch ( ) : string
리턴 string

run() 공개 메소드

Executes the widget.
public run ( ) : string
리턴 string the result of widget execution to be outputted.

프로퍼티 상세

$attribute 공개적으로 프로퍼티

the model attribute that this widget is associated with.
public $attribute

$checked 공개적으로 프로퍼티

the control for setting the "checked" attribute in the input tag.
public $checked

$encodeOffText 공개적으로 프로퍼티

whether the off text should be HTML-encoded.
public $encodeOffText

$encodeOnText 공개적으로 프로퍼티

whether the on text should be HTML-encoded.
public $encodeOnText

$inputOptions 공개적으로 프로퍼티

the HTML attributes for the underlying input tag.
또한 보기: [yii\helpers\BaseHtml::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $inputOptions

$model 공개적으로 프로퍼티

the data model that this widget is associated with.
public $model

$name 공개적으로 프로퍼티

the input name. This must be set if [[model]] and [[attribute]] are not set.
public $name

$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 ]
public $offIcon

$offText 공개적으로 프로퍼티

the text displaying the unchecked status. This can be used in conjunction with the [[offIcon]].
public $offText

$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 ]
public $onIcon

$onText 공개적으로 프로퍼티

the text displaying the checked status. This can be used in conjunction with the [[onIcon]].
public $onText

$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.
또한 보기: [yii\helpers\BaseHtml::renderTagAttributes()](http://www.yiiframework.com/doc-2.0/yii-helpers-basehtml.html#renderTagAttributes()-detail) for details on how attributes are being rendered.
public $options

$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.
public $uncheck

$value 공개적으로 프로퍼티

the input value. If not set, it will take the default value "1".
public $value