You are here

function bootstrap_carousel_if_requirements in Bootstrap Carousel Image Formatter 8.3

Implements hook_requirements().

File

./bootstrap_carousel_if.install, line 13
Install, update and uninstall functions for the Bootstrap carousel if.

Code

function bootstrap_carousel_if_requirements($phase) {
  $requirements = [];
  if (!\Drupal::service('theme_handler')
    ->themeExists('bootstrap')) {
    $url = Url::fromUri('https://www.drupal.org/project/bootstrap');
    $requirements['bootstrap_carousel_if'] = [
      'title' => t('Bootstrap theme missing'),
      'description' => t('Bootstrap carousel formatter needs Bootstrap theme, please install and enable:
      <a href=":url" target="_blank">https://www.drupal.org/project/bootstrap</a>', [
        ':url' => $url
          ->toUriString(),
      ]),
      'severity' => REQUIREMENT_ERROR,
    ];
  }
  return $requirements;
}