function TestThemeHooks::elementInfoAlter

Implements hook_element_info_alter().

Attributes

#[Hook('element_info_alter')]

File

core/modules/system/tests/themes/test_theme/src/Hook/TestThemeHooks.php, line 31

Class

TestThemeHooks
Hook implementations for test_theme.

Namespace

Drupal\test_theme\Hook

Code

public function elementInfoAlter(array &$info) : void {
  // Decrease the default size of textfields.
  if (isset($info['textfield']['#size'])) {
    $info['textfield']['#size'] = 40;
  }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.