diff --git a/core/lib/Drupal/Core/Render/Element/Checkbox.php b/core/lib/Drupal/Core/Render/Element/Checkbox.php index 6574685..5f39bcc 100644 --- a/core/lib/Drupal/Core/Render/Element/Checkbox.php +++ b/core/lib/Drupal/Core/Render/Element/Checkbox.php @@ -13,6 +13,17 @@ /** * Provides a form element for a single checkbox. * + * Properties: + * - #return_value: The value to return when the checkbox is checked. + * + * Usage example: + * @code + * $form['copy'] = array( + * '#type' => 'checkbox', + * '#title' => t('Send me a copy'), + * ); + * @endcode + * * @see \Drupal\Core\Render\Element\Checkboxes * * @FormElement("checkbox") diff --git a/core/lib/Drupal/Core/Render/Element/Checkboxes.php b/core/lib/Drupal/Core/Render/Element/Checkboxes.php index 1891ceb..ac36134 100644 --- a/core/lib/Drupal/Core/Render/Element/Checkboxes.php +++ b/core/lib/Drupal/Core/Render/Element/Checkboxes.php @@ -12,9 +12,20 @@ /** * Provides a form element for a set of checkboxes. * - * #options is an associative array, where the key is the #return_value of the - * checkbox and the value is displayed. The #options array cannot have a 0 key, - * as it would not be possible to discern checked and unchecked states. + * Properties: + * - #options: An associative array, where the key is the #return_value of the + * checkbox and the value is displayed. The #options array cannot have a 0 + * key, as it would not be possible to discern checked and unchecked states. + * + * Usage example: + * @code + * $form['high_school']['tests_taken'] = array( + * '#type' => 'checkboxes', + * '#options' => array('SAT' => t('SAT'), 'ACT' => t('ACT'))), + * '#title' => t('What standardized tests did you take?'), + * ... + * ); + * @endcode * * @see \Drupal\Core\Render\Element\Radios * @see \Drupal\Core\Render\Element\Checkbox diff --git a/core/lib/Drupal/Core/Render/Element/LanguageSelect.php b/core/lib/Drupal/Core/Render/Element/LanguageSelect.php index 433e508..3b01ba1 100644 --- a/core/lib/Drupal/Core/Render/Element/LanguageSelect.php +++ b/core/lib/Drupal/Core/Render/Element/LanguageSelect.php @@ -12,6 +12,8 @@ /** * Provides a form element for selecting a language. * + * @see \Drupal\Core\Render\Element\Select + * * @FormElement("language_select") */ class LanguageSelect extends FormElement { diff --git a/core/lib/Drupal/Core/Render/Element/Radio.php b/core/lib/Drupal/Core/Render/Element/Radio.php index 3b5f144..2e8b28c 100644 --- a/core/lib/Drupal/Core/Render/Element/Radio.php +++ b/core/lib/Drupal/Core/Render/Element/Radio.php @@ -12,7 +12,11 @@ /** * Provides a form element for a single radio button. * + * This is an internal element that is primarily used to render the radios form + * element. Refer to \Drupal\Core\Render\Element\Radios for more documentation. + * * @see \Drupal\Core\Render\Element\Radios + * @see \Drupal\Core\Render\Element\Checkbox * * @FormElement("radio") */ diff --git a/core/lib/Drupal/Core/Render/Element/Radios.php b/core/lib/Drupal/Core/Render/Element/Radios.php index 4b27b5a..ccc7ff2 100644 --- a/core/lib/Drupal/Core/Render/Element/Radios.php +++ b/core/lib/Drupal/Core/Render/Element/Radios.php @@ -13,8 +13,23 @@ /** * Provides a form element for a set of radio buttons. * + * Properties: + * - #options: An associative array, where the keys are the returned values for + * each radio button, and the values are the labels next to each radio button. + * + * Usage example: + * @code + * $form['settings']['active'] = array( + * '#type' => 'radios', + * '#title' => t('Poll status'), + * '#default_value' => 1 + * '#options' => array(0 => t('Closed'), 1 => t('Active'), + * ); + * @endcode + * * @see \Drupal\Core\Render\Element\Checkboxes * @see \Drupal\Core\Render\Element\Radio + * @see \Drupal\Core\Render\Element\Select * * @FormElement("radios") */ diff --git a/core/lib/Drupal/Core/Render/Element/Select.php b/core/lib/Drupal/Core/Render/Element/Select.php index 9f30c68..f61de80 100644 --- a/core/lib/Drupal/Core/Render/Element/Select.php +++ b/core/lib/Drupal/Core/Render/Element/Select.php @@ -13,8 +13,12 @@ /** * Provides a form element for a drop-down menu or scrolling selection box. * - * See #empty_option and #empty_value for an explanation of various settings for - * a select element, including behavior if #required is TRUE or FALSE. + * Properties: + * - #options: An associative array, where the keys are the retured values for + * each select element, and the values are label next to each select element. + * - #empty_option: The label that will be displayed to denote no selection. + * - #empty_value: The value of the select element that is used to denote no + * selection. * * @FormElement("select") */ diff --git a/core/lib/Drupal/Core/Render/Element/Tableselect.php b/core/lib/Drupal/Core/Render/Element/Tableselect.php index a3ec290..480465f 100644 --- a/core/lib/Drupal/Core/Render/Element/Tableselect.php +++ b/core/lib/Drupal/Core/Render/Element/Tableselect.php @@ -14,9 +14,14 @@ /** * Provides a form element for a table with radios or checkboxes in left column. * - * Build the table headings and columns with the #headers property, and the rows - * with the #options property. See https://www.drupal.org/node/94510 for a full - * explanation. + * Properties: + * - #headers: Table headers used in the table. + * - #options: An associative array of key value pairs where the key is the + * value returned when user selects the radio button or checkbox, and the + * value is the row of table data. + * + * Usage example: + * See https://www.drupal.org/node/94510 for a example and full explanation. * * @see \Drupal\Core\Render\Element\Table * diff --git a/core/lib/Drupal/Core/Render/Element/Weight.php b/core/lib/Drupal/Core/Render/Element/Weight.php index ffcda6b..b33a8d6 100644 --- a/core/lib/Drupal/Core/Render/Element/Weight.php +++ b/core/lib/Drupal/Core/Render/Element/Weight.php @@ -12,8 +12,22 @@ /** * Provides a form element for input of a weight. * - * Weights are integers used to indicate ordering, with larger numbers later - * in the order. + * Weights are integers used to indicate ordering, with larger numbers later in + * the order. + * + * Properties: + * - #delta: The range of possible weight values used. A delta of 10 would + * indicate possible weight values between 10 and -10. + * + * Usage example: + * @code + * $form['weight'] = array( + * '#type' => 'weight', + * '#title' => t('Weight'), + * '#default_value' => $edit['weight'], + * '#delta' => 10, + * ); + * @endcode * * @FormElement("weight") */