views_merge_rows.install in Views Merge Rows 8
Same filename and directory in other branches
Module install file.
File
views_merge_rows.installView source
<?php
/**
* @file
* Module install file.
*/
/**
* Implements hook_install().
*/
function views_merge_rows_install() {
$config = \Drupal::service('config.factory')
->getEditable('views.settings');
$display_extenders = $config
->get('display_extenders') ?: [];
$display_extenders[] = 'views_merge_rows';
$config
->set('display_extenders', $display_extenders);
$config
->save();
}
/**
* Implements hook_uninstall().
*/
function views_merge_rows_uninstall() {
$config = \Drupal::service('config.factory')
->getEditable('views.settings');
$display_extenders = $config
->get('display_extenders') ?: [];
$key = array_search('views_merge_rows', $display_extenders);
if ($key !== FALSE) {
unset($display_extenders[$key]);
$config
->set('display_extenders', $display_extenders);
$config
->save();
}
}
Functions
Name | Description |
---|---|
views_merge_rows_install | Implements hook_install(). |
views_merge_rows_uninstall | Implements hook_uninstall(). |