3 namespace Drupal\path\Form;
5 use Drupal\Core\Form\FormStateInterface;
9 * Provides the path edit form.
13 class EditForm extends PathFormBase {
18 public function getFormId() {
19 return 'path_admin_edit';
25 protected function buildPath($pid) {
26 return $this->aliasStorage->load(['pid' => $pid]);
32 public function buildForm(array $form, FormStateInterface $form_state, $pid = NULL) {
33 $form = parent::buildForm($form, $form_state, $pid);
35 $form['#title'] = $this->path['alias'];
38 '#value' => $this->path['pid'],
41 $url = new Url('path.delete', [
42 'pid' => $this->path['pid'],
45 if ($this->getRequest()->query->has('destination')) {
46 $url->setOption('query', $this->getDestinationArray());
49 $form['actions']['delete'] = [
51 '#title' => $this->t('Delete'),
54 'class' => ['button', 'button--danger'],