You are here

public function SliderForm::buildForm in Image sliders 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 EntityForm::buildForm

File

src/Form/SliderForm.php, line 19

Class

SliderForm
Form controller for the image_slider entity edit forms.

Namespace

Drupal\image_slider\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {

  /* @var $entity \Drupal\image_slider\Entity\Slider */
  $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;
}