Delete confirmation form for config_test entities.
Expanded class hierarchy of ConfigTestDeleteForm
class ConfigTestDeleteForm extends ConfirmFormBase {
/**
* The config_test entity to be deleted.
*
* @var \Drupal\config_test\Plugin\Core\Entity\ConfigTest.
*/
protected $configTest;
/**
* {@inheritdoc}
*/
protected function getQuestion() {
return t('Are you sure you want to delete %label', array(
'%label' => $this->configTest
->label(),
));
}
/**
* {@inheritdoc}
*/
protected function getConfirmText() {
return t('Delete');
}
/**
* {@inheritdoc}
*/
protected function getCancelPath() {
return 'admin/structure/config_test';
}
/**
* {@inheritdoc}
*/
public function getFormID() {
return 'config_test_delete_form';
}
/**
* Implements \Drupal\Drupal\Core\Form\ConfirmFormBase::buildForm().
*
* @param \Drupal\config_test\ConfigTestInterface $config_test
* (optional) The ConfigTestInterface object to delete.
*/
public function buildForm(array $form, array &$form_state, ConfigTestInterface $config_test = NULL) {
$this->configTest = $config_test;
return parent::buildForm($form, $form_state);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, array &$form_state) {
$this->configTest
->delete();
drupal_set_message(String::format('%label configuration has been deleted.', array(
'%label' => $this->configTest
->label(),
)));
$form_state['redirect'] = 'admin/structure/config_test';
}
}
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigTestDeleteForm:: |
protected | property | The config_test entity to be deleted. | |
ConfigTestDeleteForm:: |
public | function |
Implements \Drupal\Drupal\Core\Form\ConfirmFormBase::buildForm(). Overrides ConfirmFormBase:: |
|
ConfigTestDeleteForm:: |
protected | function |
Returns the page to go to if the user cancels the action. Overrides ConfirmFormBase:: |
|
ConfigTestDeleteForm:: |
protected | function |
Returns a caption for the button that confirms the action. Overrides ConfirmFormBase:: |
|
ConfigTestDeleteForm:: |
public | function |
Returns a unique string identifying the form. Overrides FormInterface:: |
|
ConfigTestDeleteForm:: |
protected | function |
Returns the question to ask the user. Overrides ConfirmFormBase:: |
|
ConfigTestDeleteForm:: |
public | function |
Form submission handler. Overrides FormInterface:: |
|
ConfirmFormBase:: |
protected | function | Returns a caption for the link which cancels the action. | 2 |
ConfirmFormBase:: |
protected | function | Returns additional text to display as a description. | 10 |
ConfirmFormBase:: |
protected | function | Returns the internal name used to refer to the confirmation item. | |
ConfirmFormBase:: |
public | function |
Implements \Drupal\Core\Form\FormInterface::validateForm(). Overrides FormInterface:: |
1 |