You are here

public function Custom::preRenderCustomForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/field/Custom.php \Drupal\views\Plugin\views\field\Custom::preRenderCustomForm()
  2. 10 core/modules/views/src/Plugin/views/field/Custom.php \Drupal\views\Plugin\views\field\Custom::preRenderCustomForm()

Prerender function to move the textarea to the top of a form.

Parameters

array $form: The form build array.

Return value

array The modified form build array.

File

core/modules/views/src/Plugin/views/field/Custom.php, line 84

Class

Custom
A handler to provide a field that is completely custom by the administrator.

Namespace

Drupal\views\Plugin\views\field

Code

public function preRenderCustomForm($form) {
  $form['text'] = $form['alter']['text'];
  $form['help'] = $form['alter']['help'];
  unset($form['alter']['text']);
  unset($form['alter']['help']);
  return $form;
}