You are here

public function SettingsForm::buildForm in JSON:API Include 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/SettingsForm.php, line 32

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\jsonapi_include\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('jsonapi_include.settings');
  $form['use_include_query'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Use jsonapi_include query in url'),
    '#default_value' => $config
      ->get('use_include_query'),
    '#description' => $this
      ->t('Example: http://example.com/jsonapi/node/article?include=field_tags&jsonapi_include=1'),
  ];
  return parent::buildForm($form, $form_state);
}