function Result::buildOptionsForm

Overrides AreaPluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/area/Result.php, line 34

Class

Result
Views area handler to display some configurable result summary.

Namespace

Drupal\views\Plugin\views\area

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $item_list = [
    '#theme' => 'item_list',
    '#items' => [
      '@start -- ' . $this->t('The initial record number in the set.'),
      '@end -- ' . $this->t('The last record number in the set.'),
      '@total -- ' . $this->t('The total records in the set.'),
      '@label -- ' . $this->t('The human-readable name of the view.'),
      '@per_page -- ' . $this->t('The number of items per page.'),
      '@current_page -- ' . $this->t('The current page number.'),
      '@current_record_count -- ' . $this->t('The current page record count.'),
      '@page_count -- ' . $this->t('The total page count.'),
    ],
  ];
  $list = \Drupal::service('renderer')->render($item_list);
  $form['content'] = [
    '#title' => $this->t('Display'),
    '#type' => 'textarea',
    '#rows' => 3,
    '#default_value' => $this->options['content'],
    '#description' => $this->t('You may use HTML code in this field. The following tokens are supported:') . $list,
  ];
}

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