You are here

public function CssInjectorDuplicateForm::form in Asset Injector 8

Gets the actual form array to be built.

Overrides CssInjectorForm::form

See also

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

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

File

src/Form/CssInjectorDuplicateForm.php, line 17

Class

CssInjectorDuplicateForm
Class CssInjectorDuplicateForm.

Namespace

Drupal\asset_injector\Form

Code

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

  /** @var \Drupal\asset_injector\Entity\CssInjector $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);
}