path = $path; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('path.crud') ); } /** * Implements \Drupal\Core\Form\FormInterface::getFormID(). */ public function getFormID() { return 'path_alias_delete'; } /** * Implements \Drupal\Core\Form\ConfirmFormBase::getQuestion(). */ public function getQuestion() { return t('Are you sure you want to delete path alias %title?', array('%title' => $this->pathAlias['alias'])); } /** * Implements \Drupal\Core\Form\ConfirmFormBase::getCancelPath(). */ public function getCancelPath() { return 'admin/config/search/path'; } /** * Overrides \Drupal\Core\Form\ConfirmFormBase::buildForm(). */ public function buildForm(array $form, array &$form_state, $pid = NULL) { $this->pathAlias = $this->path->load(array('pid' => $pid)); return parent::buildForm($form, $form_state); } /** * Implements \Drupal\Core\Form\FormInterface::submitForm(). */ public function submitForm(array &$form, array &$form_state) { $this->path->delete(array('pid' => $this->pathAlias['pid'])); $form_state['redirect'] = 'admin/config/search/path'; } }