Same filename in other branches
  1. 4.x src/Form/QuickTabsInstanceDeleteForm.php

Namespace

Drupal\quicktabs\Form

Fichier

src/Form/QuickTabsInstanceDeleteForm.php

View source
<?php

namespace Drupal\quicktabs\Form;

use Drupal\Core\Entity\EntityConfirmFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;

/**
 * Class QuickTabsInstanceDeleteForm.
 */
class QuickTabsInstanceDeleteForm extends EntityConfirmFormBase {
    
    /**
     * {@inheritdoc}
     */
    public function getQuestion() {
        $entity = $this->entity;
        return $this->t('Are you sure you want to delete this quicktabs instance with name %name?', [
            '%name' => $entity->getLabel(),
        ]);
    }
    
    /**
     * {@inheritdoc}
     */
    public function getCancelUrl() {
        return new Url('quicktabs.admin');
    }
    
    /**
     * {@inheritdoc}
     */
    public function getConfirmText() {
        return $this->t('Delete');
    }
    
    /**
     * {@inheritdoc}
     */
    public function submitForm(array &$form, FormStateInterface $form_state) {
        $this->entity
            ->delete();
        $form_state->setRedirectUrl($this->getCancelUrl());
    }

}

Classes

Titre Deprecated Résumé
QuickTabsInstanceDeleteForm Class QuickTabsInstanceDeleteForm.