You are here

public function AddWordsForm::buildForm in Restrict Abusive Words 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 FormInterface::buildForm

File

src/Form/AddWordsForm.php, line 30
Contains \Drupal\restrict_abusive_words\Form\AdminSettingForm.

Class

AddWordsForm
Contribute form.

Namespace

Drupal\restrict_abusive_words\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['check_word'] = array(
    '#type' => 'textfield',
    '#title' => t('Look up for abusive word'),
    '#description' => t('Look up for abusive word.'),
    '#maxlength' => 60,
    '#autocomplete_path' => 'admin/config/content/restrict_abusive_words/autocomplete',
  );
  $form['words_list'] = array(
    '#type' => 'textarea',
    '#title' => t('Words'),
    '#description' => t("Enter a word or phrase you want to restrict as abusive. You can enter multiple word by adding more word on a new line."),
    '#required' => TRUE,
  );
  $form['save_wordlist'] = array(
    '#type' => 'submit',
    '#value' => t('Add abusive word'),
  );
  return $form;
}