Same filename in other branches
Namespace
Drupal\quicktabs\FormFile
-
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
Title | Deprecated | Summary |
---|---|---|
QuickTabsInstanceDeleteForm | Class QuickTabsInstanceDeleteForm. |