You are here

public function RecordshortenClearAll::buildForm in Shorten URLs 8

Same name and namespace in other branches
  1. 8.2 modules/record_shorten/src/Form/RecordshortenClearAll.php \Drupal\record_shorten\Form\RecordshortenClearAll::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 FormInterface::buildForm

File

modules/record_shorten/src/Form/RecordshortenClearAll.php, line 24

Class

RecordshortenClearAll
Report form.

Namespace

Drupal\record_shorten\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['warning'] = array(
    '#markup' => '<p><strong>' . t('Warning: there is no confirmation page. Cleared records are permanently deleted.') . '</strong></p>',
  );
  $form['note'] = array(
    '#markup' => '<p>' . t('Note: clearing records does not clear the Shorten URLs cache.') . ' ' . t('Also, URLs already in the cache are not recorded again.') . '</p>',
  );
  $form['clear'] = array(
    '#type' => 'submit',
    '#value' => t('Clear all records'),
  );
  return $form;
}