3 namespace Drupal\Core\Render\Element;
6 * Provides a display-only form element with an optional title and description.
8 * Note: since this is a read-only field, setting the #required property will do
9 * nothing except theme the form element to look as if it were actually required
10 * (i.e. by placing a red star next to the #title).
12 * @FormElement("item")
14 class Item extends FormElement {
19 public function getInfo() {
21 // Forms that show author fields to both anonymous and authenticated users
22 // need to dynamically switch between #type 'textfield' and #type 'item'
23 // to automatically take over the authenticated user's information.
24 // Therefore, we allow #type 'item' to receive input, which is internally
25 // assigned by Form API based on the #default_value or #value properties.
28 '#theme_wrappers' => ['form_element'],