You are here

public function LibraryItemForm::getFormId in Paragraphs 8

Returns a unique string identifying the form.

The returned ID should be a unique string that can be a valid PHP function name, since it's used in hook implementation names such as hook_form_FORM_ID_alter().

Return value

string The unique string identifying the form.

Overrides EntityForm::getFormId

File

modules/paragraphs_library/src/Form/LibraryItemForm.php, line 26

Class

LibraryItemForm
Form controller for paragraph type forms.

Namespace

Drupal\paragraphs_library\Form

Code

public function getFormId() {

  // If the entity is not new, add the entity id. This will allow having more
  // than one form open when editing a library item within another.
  // To alter this form use hook_form_BASE_FORM_ID_alter.
  if ($this->entity
    ->id()) {
    return 'paragraphs_library_item_edit_form_' . $this->entity
      ->id();
  }
  return 'paragraphs_library_item_edit_form';
}