From 30e45a4aea5e3fd458a2de9b8696337354ab8c88 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 26 Feb 2015 19:06:51 +0100 Subject: [PATCH] improve documentation about uncheck and unselect in activefield fixes #7465 --- framework/widgets/ActiveField.php | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/framework/widgets/ActiveField.php b/framework/widgets/ActiveField.php index 1528fa8..3ea6d2c 100644 --- a/framework/widgets/ActiveField.php +++ b/framework/widgets/ActiveField.php @@ -449,10 +449,11 @@ class ActiveField extends Component * - 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 * 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 * 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. * * 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, * 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. + * 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 * 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. * * 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. * - 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 - * 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 * 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: * * - 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. * - 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: @@ -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: * * - 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. * - 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: