You are here

public function ViewsAjax::buildOptionsForm in Views Ajax Get 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/views/display_extender/ViewsAjax.php \Drupal\views_ajax_get\Plugin\views\display_extender\ViewsAjax::buildOptionsForm()

Provide a form to edit options for this plugin.

Overrides DisplayExtenderPluginBase::buildOptionsForm

File

src/Plugin/views/display_extender/ViewsAjax.php, line 32

Class

ViewsAjax
Defines a display extender for views_ajax_get.

Namespace

Drupal\views_ajax_get\Plugin\views\display_extender

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  if ($form_state
    ->get('section') === 'use_ajax') {
    $form['ajax_get'] = [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Use GET requests'),
      '#default_value' => $this->options['ajax_get'],
    ];
  }
}