EditDetails::buildForm

public EditDetails::buildForm(array $form, FormStateInterface $form_state)

Form constructor.

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 The form structure.

Overrides FormInterface::buildForm

File

core/modules/views_ui/src/Form/Ajax/EditDetails.php, line 30

Class

EditDetails
Provides a form for editing the details of a View.

Namespace

Drupal\views_ui\Form\Ajax

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
public function buildForm(array $form, FormStateInterface $form_state) {
  $view = $form_state->get('view');
 
  $form['#title'] = $this->t('Name and description');
  $form['#section'] = 'details';
 
  $form['details'] = array(
    '#theme_wrappers' => array('container'),
    '#attributes' => array('class' => array('scroll'), 'data-drupal-views-scroll' => TRUE),
  );
  $form['details']['label'] = array(
    '#type' => 'textfield',
    '#title' => t('Administrative name'),
    '#default_value' => $view->label(),
  );
  $form['details']['langcode'] = array(
    '#type' => 'language_select',
    '#title' => $this->t('View language'),
    '#description' => $this->t('Language of labels and other textual elements in this view.'),
    '#default_value' => $view->get('langcode'),
  );
  $form['details']['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Administrative description'),
    '#default_value' => $view->get('description'),
  );
  $form['details']['tag'] = array(
    '#type' => 'textfield',
    '#title' => t('Administrative tags'),
    '#description' => t('Enter a comma-separated list of words to describe your view.'),
    '#default_value' => $view->get('tag'),
    '#autocomplete_route_name' => 'views_ui.autocomplete',
  );
 
  $view->getStandardButtons($form, $form_state, 'views_ui_edit_details_form');
  return $form;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.