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

Breadcrumb

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

function Counter::buildOptionsForm

Overrides FieldPluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/field/Counter.php, line 38

Class

Counter
Field handler to show a counter of the current row.

Namespace

Drupal\views\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    $form['counter_start'] = [
        '#type' => 'textfield',
        '#title' => $this->t('Starting value'),
        '#default_value' => $this->options['counter_start'],
        '#description' => $this->t('Specify the number the counter should start at.'),
        '#size' => 2,
    ];
    parent::buildOptionsForm($form, $form_state);
}

API Navigation

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