You are here

public function LtiToolProviderConsumerForm::buildForm in LTI Tool Provider 8

Same name and namespace in other branches
  1. 2.x src/Form/LtiToolProviderConsumerForm.php \Drupal\lti_tool_provider\Form\LtiToolProviderConsumerForm::buildForm()

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 EntityForm::buildForm

File

src/Form/LtiToolProviderConsumerForm.php, line 20

Class

LtiToolProviderConsumerForm
Form for editing a lti_tool_provider_consumer entity.

Namespace

Drupal\lti_tool_provider\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) : array {
  $form = parent::buildForm($form, $form_state);
  $entity = $this->entity;
  $form['langcode'] = [
    '#title' => $this
      ->t('Language'),
    '#type' => 'language_select',
    '#default_value' => $entity
      ->getUntranslated()
      ->language()
      ->getId(),
    '#languages' => Language::STATE_ALL,
  ];
  return $form;
}