function UpdateReady::buildForm

Same name and namespace in other branches
  1. 9 core/modules/update/src/Form/UpdateReady.php \Drupal\update\Form\UpdateReady::buildForm()
  2. 10 core/modules/update/src/Form/UpdateReady.php \Drupal\update\Form\UpdateReady::buildForm()
  3. 11.x core/modules/update/src/Form/UpdateReady.php \Drupal\update\Form\UpdateReady::buildForm()

Overrides FormInterface::buildForm

File

core/modules/update/src/Form/UpdateReady.php, line 90

Class

UpdateReady
Configure update settings for this site.

Namespace

Drupal\update\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
    $this->moduleHandler
        ->loadInclude('update', 'inc', 'update.manager');
    if (!_update_manager_check_backends($form, 'update')) {
        return $form;
    }
    $form['backup'] = [
        '#prefix' => '<strong>',
        '#markup' => $this->t('Back up your database and site before you continue. <a href=":backup_url">Learn how</a>.', [
            ':backup_url' => 'https://www.drupal.org/node/22281',
        ]),
        '#suffix' => '</strong>',
    ];
    $form['maintenance_mode'] = [
        '#title' => $this->t('Perform updates with site in maintenance mode (strongly recommended)'),
        '#type' => 'checkbox',
        '#default_value' => TRUE,
    ];
    $form['actions'] = [
        '#type' => 'actions',
    ];
    $form['actions']['submit'] = [
        '#type' => 'submit',
        '#value' => $this->t('Continue'),
    ];
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.