You are here

function dynamic_banner_install in Dynamic Banner 8

Same name and namespace in other branches
  1. 6 dynamic_banner.install \dynamic_banner_install()
  2. 7.2 dynamic_banner.install \dynamic_banner_install()
  3. 7 dynamic_banner.install \dynamic_banner_install()
  4. 8.x dynamic_banner.install \dynamic_banner_install()

Implements hook_install().

File

./dynamic_banner.install, line 83
The install file of dynamic_banner

Code

function dynamic_banner_install() {

  // default settings install
  $config = \Drupal::service('config.factory')
    ->getEditable('dynamic_banner.settings');

  // Set and save new message value.
  $config
    ->set('dynamic_banner_display_setting', 'urltext')
    ->set('dynamic_banner_display_errors', FALSE)
    ->set('dynamic_banner_block_name', 'Dynamic Banner Block')
    ->set('dynamic_banner_mode', 'normal')
    ->set('dynamic_banner_file_save_path', 'public://banners/')
    ->save();
  \Drupal::messenger()
    ->addWarning(t('Dynamic Banner Module installed successfully.'));
}