Same name and namespace in other branches
  1. 8.9.x core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php \Drupal\config_translation\Form\ConfigTranslationDeleteForm::buildForm()
  2. 9 core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php \Drupal\config_translation\Form\ConfigTranslationDeleteForm::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 ConfirmFormBase::buildForm

File

core/modules/config_translation/src/Form/ConfigTranslationDeleteForm.php, line 116

Class

ConfigTranslationDeleteForm
Builds a form to delete configuration translation.

Namespace

Drupal\config_translation\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, RouteMatchInterface $route_match = NULL, $plugin_id = NULL, $langcode = NULL) {

  /** @var \Drupal\config_translation\ConfigMapperInterface $mapper */
  $mapper = $this->configMapperManager
    ->createInstance($plugin_id);
  $mapper
    ->populateFromRouteMatch($route_match);
  $language = $this->languageManager
    ->getLanguage($langcode);
  if (!$language) {
    throw new NotFoundHttpException();
  }
  $this->mapper = $mapper;
  $this->language = $language;
  return parent::buildForm($form, $form_state);
}