You are here

public function FrontPageHomeLinksForm::buildForm in Front Page 8

Same name and namespace in other branches
  1. 9.1.x src/Form/FrontPageHomeLinksForm.php \Drupal\front_page\Form\FrontPageHomeLinksForm::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 ConfigFormBase::buildForm

File

src/Form/FrontPageHomeLinksForm.php, line 30

Class

FrontPageHomeLinksForm
Configure site information settings for this site.

Namespace

Drupal\front_page\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  global $base_url;
  $config = $this
    ->config('front_page.settings');
  $form['front_page_home_link_path'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Redirect your site HOME links to'),
    '#default_value' => $config
      ->get('home_link_path'),
    '#cols' => 20,
    '#rows' => 1,
    '#description' => $this
      ->t("Specify where the user should be redirected to. An example would be <em>/node/12</em>. Leave blank when you're not using HOME redirect."),
    '#field_prefix' => $base_url,
  ];
  return parent::buildForm($form, $form_state);
}