You are here

public function CodeFilter::settingsForm in Code Filter 8

Generates a filter's settings form.

Parameters

array $form: A minimally prepopulated form array.

\Drupal\Core\Form\FormStateInterface $form_state: The state of the (entire) configuration form.

Return value

array The $form array with additional form elements for the settings of this filter. The submitted form values should match $this->settings.

Overrides FilterBase::settingsForm

File

src/Plugin/Filter/CodeFilter.php, line 28

Class

CodeFilter
Text filter for highlighting PHP source code.

Namespace

Drupal\codefilter\Plugin\Filter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form['nowrap_expand'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Expand code boxes on hover.'),
    '#description' => $this
      ->t('By default, code boxes inherit text wrapping from the active theme. With this setting, code boxes will not wrap, but will expand to full width on hover (with Javascript).'),
    '#default_value' => $this->settings['nowrap_expand'],
  ];
  return $form;
}