Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Result.php

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 -- the initial record number in the set',
            '@end -- the last record number in the set',
            '@total -- the total records in the set',
            '@label -- the human-readable name of the view',
            '@per_page -- the number of items per page',
            '@current_page -- the current page number',
            '@current_record_count -- the current page record count',
            '@page_count -- 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,
    ];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal