You are here

public function PlainText::buildOptionsForm in Recipe 8.2

Provide a form to edit options for this plugin.

Overrides StylePluginBase::buildOptionsForm

File

src/Plugin/views/style/PlainText.php, line 73

Class

PlainText
Default style plugin to render recipes in plain text.

Namespace

Drupal\recipe\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['wordwrap_width'] = [
    '#type' => 'number',
    '#title' => $this
      ->t('Wordwrap width'),
    '#default_value' => $this->options['wordwrap_width'],
    '#description' => $this
      ->t('The number of characters at which text will wrap to the next line.'),
  ];
  $form['hide_empty'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Hide empty fields'),
    '#default_value' => $this->options['hide_empty'],
    '#description' => $this
      ->t('Do not display fields or labels for fields that are empty.'),
  ];
  $form['row_separator'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Row separator'),
    '#default_value' => $this->options['row_separator'],
    '#description' => $this
      ->t('Text used to separate multiple recipes. Any HTML tags will be stripped.'),
  ];
}