function SiteSettingsForm::getDatabaseErrorsTemplate

Same name in other branches
  1. 9 core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php \Drupal\Core\Installer\Form\SiteSettingsForm::getDatabaseErrorsTemplate()
  2. 8.9.x core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php \Drupal\Core\Installer\Form\SiteSettingsForm::getDatabaseErrorsTemplate()
  3. 11.x core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php \Drupal\Core\Installer\Form\SiteSettingsForm::getDatabaseErrorsTemplate()

Gets the inline template render array to display the database errors.

Parameters

\Drupal\Core\StringTranslation\TranslatableMarkup[] $errors: The database errors to list.

Return value

mixed[] The inline template render array to display the database errors.

2 calls to SiteSettingsForm::getDatabaseErrorsTemplate()
install_check_requirements in core/includes/install.core.inc
Checks installation requirements and reports any errors.
SiteSettingsForm::getDatabaseErrors in core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php
Get any database errors and links them to a form element.

File

core/lib/Drupal/Core/Installer/Form/SiteSettingsForm.php, line 214

Class

SiteSettingsForm
Provides a form to configure and rewrite settings.php.

Namespace

Drupal\Core\Installer\Form

Code

public static function getDatabaseErrorsTemplate(array $errors) {
    return [
        '#type' => 'inline_template',
        '#template' => '{% trans %}Resolve all issues below to continue the installation. For help configuring your database server, see the <a href="https://www.drupal.org/docs/installing-drupal">installation handbook</a>, or contact your hosting provider.{% endtrans %}{{ errors }}',
        '#context' => [
            'errors' => [
                '#theme' => 'item_list',
                '#items' => $errors,
            ],
        ],
    ];
}

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