You are here

CssInjectorDuplicateForm.php in Asset Injector 8

File

src/Form/CssInjectorDuplicateForm.php
View source
<?php

namespace Drupal\asset_injector\Form;

use Drupal\Core\Form\FormStateInterface;

/**
 * Class CssInjectorDuplicateForm.
 *
 * @package Drupal\asset_injector\Form
 */
class CssInjectorDuplicateForm extends CssInjectorForm {

  /**
   * {@inheritdoc}
   */
  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);
  }

}

Classes

Namesort descending Description
CssInjectorDuplicateForm Class CssInjectorDuplicateForm.