ProtectionRuleEditForm.php in User protect 8
File
src/Form/ProtectionRuleEditForm.php
View source
<?php
namespace Drupal\userprotect\Form;
use Drupal\Core\Form\FormStateInterface;
class ProtectionRuleEditForm extends ProtectionRuleFormBase {
public function form(array $form, FormStateInterface $form_state) {
$form['#title'] = $this
->t('Edit protection rule %name', [
'%name' => $this->entity
->label(),
]);
$form = parent::form($form, $form_state);
return $form;
}
public function save(array $form, FormStateInterface $form_state) {
parent::save($form, $form_state);
$this->messenger
->addMessage($this
->t('Updated protection rule %name.', [
'%name' => $this->entity
->label(),
]));
return $this->entity;
}
}