You are here

function mobile_device_detection_install in Mobile Device Detection 8.3

Same name and namespace in other branches
  1. 8 mobile_device_detection.module \mobile_device_detection_install()
  2. 8.2 mobile_device_detection.install \mobile_device_detection_install()

Implements hook_install().

File

./mobile_device_detection.install, line 11
Default install and uninstall functions which set up default data.

Code

function mobile_device_detection_install() {

  // Enable mobile_device_detection plugin.
  $config = \Drupal::service('config.factory')
    ->getEditable('views.settings');
  $display_extenders = $config
    ->get('display_extenders') ?: [];
  $display_extenders[] = 'mobile_device_detection';
  $config
    ->set('display_extenders', $display_extenders);
  $config
    ->save();
}