PathAliasForm.php in Drupal 9        
                          
                  
                        
  
  
  
  
File
  core/modules/path/src/PathAliasForm.php
  
    View source  
  <?php
namespace Drupal\path;
use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;
class PathAliasForm extends ContentEntityForm {
  
  protected $entity;
  
  public function save(array $form, FormStateInterface $form_state) {
    parent::save($form, $form_state);
    $this
      ->messenger()
      ->addStatus($this
      ->t('The alias has been saved.'));
    $form_state
      ->setRedirect('entity.path_alias.collection');
  }
}