public function Textarea::form in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElement/Textarea.php \Drupal\webform\Plugin\WebformElement\Textarea::form()
Gets the actual configuration webform array to be built.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array An associative array contain the element's configuration webform without any default values.
Overrides TextBase::form
File
- src/
Plugin/ WebformElement/ Textarea.php, line 100
Class
- Textarea
- Provides a 'textarea' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
$form['default']['default_value']['#type'] = 'textarea';
$form['default']['default_value']['#rows'] = 3;
$form['form']['placeholder']['#type'] = 'textarea';
$form['form']['placeholder']['#rows'] = 3;
return $form;
}