PathAliasForm.php

Same filename in other branches
  1. 9 core/modules/path/src/PathAliasForm.php
  2. 8.9.x core/modules/path/src/PathAliasForm.php
  3. 10 core/modules/path/src/PathAliasForm.php

Namespace

Drupal\path

File

core/modules/path/src/PathAliasForm.php

View source
<?php

namespace Drupal\path;

use Drupal\Core\Entity\ContentEntityForm;
use Drupal\Core\Form\FormStateInterface;

/**
 * Form handler for the path alias edit forms.
 *
 * @internal
 */
class PathAliasForm extends ContentEntityForm {
    
    /**
     * The path_alias entity.
     *
     * @var \Drupal\path_alias\PathAliasInterface
     */
    protected $entity;
    
    /**
     * {@inheritdoc}
     */
    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');
    }

}

Classes

Title Deprecated Summary
PathAliasForm Form handler for the path alias edit forms.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.