You are here

protected function PublishedOrHasRoles::valueForm in Views Published or Roles 8

Options form subform for setting options.

This should be overridden by all child classes and it must define $form['value']

Overrides FilterPluginBase::valueForm

See also

buildOptionsForm()

File

src/Plugin/views/filter/PublishedOrHasRoles.php, line 50

Class

PublishedOrHasRoles
Filter by published status and by role.

Namespace

Drupal\views_published_or_roles\Plugin\views\filter

Code

protected function valueForm(&$form, FormStateInterface $form_state) {
  $form['value'] = [
    '#type' => 'select',
    '#title' => t('Select Role(s)'),
    '#size' => 30,
    '#options' => $this
      ->getValueOptions(),
    '#default_value' => $this->value,
    '#multiple' => TRUE,
  ];
}