You are here

public function RobotsTxtAdminSettingsForm::buildForm in RobotsTxt 8

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/RobotsTxtAdminSettingsForm.php, line 31

Class

RobotsTxtAdminSettingsForm
Configure robotstxt settings for this site.

Namespace

Drupal\robotstxt\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('robotstxt.settings');
  $form['robotstxt_content'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Contents of robots.txt'),
    '#default_value' => $config
      ->get('content'),
    '#cols' => 60,
    '#rows' => 20,
  ];
  return parent::buildForm($form, $form_state);
}