You are here

public function JavascriptLibrariesDeleteForm::buildForm in JavaScript Libraries Manager 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 ConfirmFormBase::buildForm

File

src/Form/JavascriptLibrariesDeleteForm.php, line 59
Contains \Drupal\javascript_libraries\Form\JavascriptLibrariesDeleteForm.

Class

JavascriptLibrariesDeleteForm

Namespace

Drupal\javascript_libraries\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $library = NULL) {
  $custom = \Drupal::config('javascript_libraries.settings')
    ->get('javascript_libraries_custom_libraries');
  if (!array_key_exists($library, $custom)) {
    drupal_set_message("The library with following identifier doesnot exist");
    return;
  }
  $this->id = $library;
  return parent::buildForm($form, $form_state);
}