function RestExport::buildOptionsForm

Same name in other branches
  1. 8.9.x core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::buildOptionsForm()
  2. 10 core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::buildOptionsForm()
  3. 11.x core/modules/rest/src/Plugin/views/display/RestExport.php \Drupal\rest\Plugin\views\display\RestExport::buildOptionsForm()

Overrides PathPluginBase::buildOptionsForm

File

core/modules/rest/src/Plugin/views/display/RestExport.php, line 312

Class

RestExport
The plugin that handles Data response callbacks for REST resources.

Namespace

Drupal\rest\Plugin\views\display

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    if ($form_state->get('section') === 'auth') {
        $form['#title'] .= $this->t('The supported authentication methods for this view');
        $form['auth'] = [
            '#type' => 'checkboxes',
            '#title' => $this->t('Authentication methods'),
            '#description' => $this->t('These are the supported authentication providers for this view. When this view is requested, the client will be forced to authenticate with one of the selected providers. Make sure you set the appropriate requirements at the <em>Access</em> section since the Authentication System will fallback to the anonymous user if it fails to authenticate. For example: require Access: Role | Authenticated User.'),
            '#options' => $this->getAuthOptions(),
            '#default_value' => $this->getOption('auth'),
        ];
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.