You are here

public function Serializer::buildOptionsForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/rest/src/Plugin/views/style/Serializer.php \Drupal\rest\Plugin\views\style\Serializer::buildOptionsForm()

Provide a form to edit options for this plugin.

Overrides StylePluginBase::buildOptionsForm

File

core/modules/rest/src/Plugin/views/style/Serializer.php, line 92
Contains \Drupal\rest\Plugin\views\style\Serializer.

Class

Serializer
The style plugin for serialized output formats.

Namespace

Drupal\rest\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['formats'] = array(
    '#type' => 'checkboxes',
    '#title' => $this
      ->t('Accepted request formats'),
    '#description' => $this
      ->t('Request formats that will be allowed in responses. If none are selected all formats will be allowed.'),
    '#options' => array_combine($this->formats, $this->formats),
    '#default_value' => $this->options['formats'],
  );
}