You are here

public function JsInjectorDuplicateForm::form in Asset Injector 8

Gets the actual form array to be built.

Overrides JsInjectorForm::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

File

src/Form/JsInjectorDuplicateForm.php, line 17

Class

JsInjectorDuplicateForm
Class JsInjectorDuplicateForm.

Namespace

Drupal\asset_injector\Form

Code

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

  /** @var \Drupal\asset_injector\Entity\JsInjector $entity */
  $entity = $this->entity
    ->createDuplicate();
  $entity->label = $this
    ->t('Duplicate of @label', [
    '@label' => $this->entity
      ->label(),
  ]);
  $this->entity = $entity;
  return parent::form($form, $form_state);
}