mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 14:26:54 +08:00
improve documentation about uncheck and unselect in activefield
fixes #7465
This commit is contained in:
@ -449,10 +449,11 @@ class ActiveField extends Component
|
|||||||
* - uncheck: string, the value associated with the uncheck state of the radio button. If not set,
|
* - uncheck: string, 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
|
* 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
|
* is not checked and is submitted, the value of this attribute will still be submitted to the server
|
||||||
* via the hidden input.
|
* via the hidden input. If you do not want any hidden input, you should explicitly set this option as null.
|
||||||
* - label: string, a label displayed next to the radio button. It will NOT be HTML-encoded. Therefore you can pass
|
* - label: string, a label displayed next to the radio button. It will NOT be HTML-encoded. Therefore you can pass
|
||||||
* in HTML code such as an image tag. If this is coming from end users, you should [[Html::encode()|encode]] it to prevent XSS attacks.
|
* in HTML code such as an image tag. If this is coming from end users, you should [[Html::encode()|encode]] it to prevent XSS attacks.
|
||||||
* When this option is specified, the radio button will be enclosed by a label tag.
|
* When this option is specified, the radio button will be enclosed by a label tag. If you do not want any label, you should
|
||||||
|
* explicitly set this option as null.
|
||||||
* - labelOptions: array, the HTML attributes for the label tag. This is only used when the "label" option is specified.
|
* - labelOptions: array, the HTML attributes for the label tag. This is only used when the "label" option is specified.
|
||||||
*
|
*
|
||||||
* The rest of the options will be rendered as the attributes of the resulting tag. The values will
|
* The rest of the options will be rendered as the attributes of the resulting tag. The values will
|
||||||
@ -494,10 +495,11 @@ class ActiveField extends Component
|
|||||||
* - uncheck: string, the value associated with the uncheck state of the radio button. If not set,
|
* - uncheck: string, 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
|
* 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
|
* is not checked and is submitted, the value of this attribute will still be submitted to the server
|
||||||
* via the hidden input.
|
* via the hidden input. If you do not want any hidden input, you should explicitly set this option as null.
|
||||||
* - label: string, a label displayed next to the checkbox. It will NOT be HTML-encoded. Therefore you can pass
|
* - label: string, a label displayed next to the checkbox. It will NOT be HTML-encoded. Therefore you can pass
|
||||||
* in HTML code such as an image tag. If this is coming from end users, you should [[Html::encode()|encode]] it to prevent XSS attacks.
|
* in HTML code such as an image tag. If this is coming from end users, you should [[Html::encode()|encode]] it to prevent XSS attacks.
|
||||||
* When this option is specified, the checkbox will be enclosed by a label tag.
|
* When this option is specified, the checkbox will be enclosed by a label tag. If you do not want any label, you should
|
||||||
|
* explicitly set this option as null.
|
||||||
* - labelOptions: array, the HTML attributes for the label tag. This is only used when the "label" option is specified.
|
* - labelOptions: array, the HTML attributes for the label tag. This is only used when the "label" option is specified.
|
||||||
*
|
*
|
||||||
* The rest of the options will be rendered as the attributes of the resulting tag. The values will
|
* The rest of the options will be rendered as the attributes of the resulting tag. The values will
|
||||||
@ -602,7 +604,8 @@ class ActiveField extends Component
|
|||||||
* except that the array keys represent the optgroup labels specified in $items.
|
* except that the array keys represent the optgroup labels specified in $items.
|
||||||
* - unselect: string, the value that will be submitted when no option is selected.
|
* - unselect: string, the value that will be submitted when no option is selected.
|
||||||
* When this attribute is set, a hidden field will be generated so that if no option is selected in multiple
|
* When this attribute is set, a hidden field will be generated so that if no option is selected in multiple
|
||||||
* mode, we can still obtain the posted unselect value.
|
* mode, we can still obtain the posted unselect value. If you do not want any hidden input,
|
||||||
|
* you should explicitly set this option as null.
|
||||||
*
|
*
|
||||||
* The rest of the options will be rendered as the attributes of the resulting tag. The values will
|
* The rest of the options will be rendered as the attributes of the resulting tag. The values will
|
||||||
* be HTML-encoded using [[Html::encode()]]. If a value is null, the corresponding attribute will not be rendered.
|
* be HTML-encoded using [[Html::encode()]]. If a value is null, the corresponding attribute will not be rendered.
|
||||||
@ -631,7 +634,8 @@ class ActiveField extends Component
|
|||||||
* @param array $options options (name => config) for the checkbox list. The following options are specially handled:
|
* @param array $options options (name => config) for the checkbox list. The following options are specially handled:
|
||||||
*
|
*
|
||||||
* - unselect: string, the value that should be submitted when none of the checkboxes is selected.
|
* - unselect: string, the value that should be submitted when none of the checkboxes is selected.
|
||||||
* By setting this option, a hidden input will be generated.
|
* By setting this option, a hidden input will be generated. If you do not want any hidden input,
|
||||||
|
* you should explicitly set this option as null.
|
||||||
* - separator: string, the HTML code that separates items.
|
* - separator: string, the HTML code that separates items.
|
||||||
* - item: callable, a callback that can be used to customize the generation of the HTML code
|
* - item: callable, a callback that can be used to customize the generation of the HTML code
|
||||||
* corresponding to a single item in $items. The signature of this callback must be:
|
* corresponding to a single item in $items. The signature of this callback must be:
|
||||||
@ -663,7 +667,8 @@ class ActiveField extends Component
|
|||||||
* @param array $options options (name => config) for the radio button list. The following options are specially handled:
|
* @param array $options options (name => config) for the radio button list. The following options are specially handled:
|
||||||
*
|
*
|
||||||
* - unselect: string, the value that should be submitted when none of the radio buttons is selected.
|
* - unselect: string, the value that should be submitted when none of the radio buttons is selected.
|
||||||
* By setting this option, a hidden input will be generated.
|
* By setting this option, a hidden input will be generated. If you do not want any hidden input,
|
||||||
|
* you should explicitly set this option as null.
|
||||||
* - separator: string, the HTML code that separates items.
|
* - separator: string, the HTML code that separates items.
|
||||||
* - item: callable, a callback that can be used to customize the generation of the HTML code
|
* - item: callable, a callback that can be used to customize the generation of the HTML code
|
||||||
* corresponding to a single item in $items. The signature of this callback must be:
|
* corresponding to a single item in $items. The signature of this callback must be:
|
||||||
|
Reference in New Issue
Block a user