You are here

public function SortableViewsStyleTrait::buildOptionsForm in Sortableviews 8

File

src/SortableViewsStyleTrait.php, line 185

Class

SortableViewsStyleTrait
Provides sortable functionality for View styles.

Namespace

Drupal\sortableviews

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  $form['weight_field'] = [
    '#type' => 'select',
    '#title' => t('Field to use for weight'),
    '#description' => t('Select the field you want Sortableviews to use for storing weights.'),
    '#options' => $this
      ->retrieveEligibleFieldsForWeight(),
    '#required' => TRUE,
    '#default_value' => $this->options['weight_field'],
  ];
  parent::buildOptionsForm($form, $form_state);
}