You are here

public function XmlSitemapCustomDeleteForm::buildForm in XML sitemap 2.x

Same name and namespace in other branches
  1. 8 xmlsitemap_custom/src/Form/XmlSitemapCustomDeleteForm.php \Drupal\xmlsitemap_custom\Form\XmlSitemapCustomDeleteForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfirmFormBase::buildForm

File

xmlsitemap_custom/src/Form/XmlSitemapCustomDeleteForm.php, line 64

Class

XmlSitemapCustomDeleteForm
Provides a form for deleting a custom link.

Namespace

Drupal\xmlsitemap_custom\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $link = '') {
  if (!($custom_link = $this->linkStorage
    ->load('custom', $link))) {
    throw new NotFoundHttpException();
  }
  else {
    $this->custom_link = $custom_link;
  }
  return parent::buildForm($form, $form_state);
}