class PathAliasForm
Same name and namespace in other branches
- 11.x core/modules/path/src/PathAliasForm.php \Drupal\path\PathAliasForm
Form handler for the path alias edit forms.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase extends \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\Core\Entity\EntityForm extends \Drupal\Core\Entity\EntityFormInterface implements \Drupal\Core\Form\FormBase
- class \Drupal\Core\Entity\ContentEntityForm extends \Drupal\Core\Entity\ContentEntityFormInterface implements \Drupal\Core\Entity\EntityForm
- class \Drupal\path\PathAliasForm implements \Drupal\Core\Entity\ContentEntityForm
- class \Drupal\Core\Entity\ContentEntityForm extends \Drupal\Core\Entity\ContentEntityFormInterface implements \Drupal\Core\Entity\EntityForm
- class \Drupal\Core\Entity\EntityForm extends \Drupal\Core\Entity\EntityFormInterface implements \Drupal\Core\Form\FormBase
Expanded class hierarchy of PathAliasForm
1 file declares its use of PathAliasForm
- path.module in core/
modules/ path/ path.module - Enables users to rename URLs.
File
-
core/
modules/ path/ src/ PathAliasForm.php, line 13
Namespace
Drupal\pathView source
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');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.