intercept_profile-8.x-1.0-alpha1/intercept_profile.install

intercept_profile.install
<?php

/**
 * @file
 * Install, update and uninstall functions for the installation profile.
 */

use Drupal\user\Entity\User;

/**
 * Implements hook_install().
 *
 * Perform actions to set up the site for this profile.
 *
 * @see system_install()
 */
function intercept_profile_install() {
  // Set front page to "node".
  \Drupal::configFactory()->getEditable('system.site')->set('page.front', '/node')->save(TRUE);

  // Assign user 1 the "administrator" role.
  $user = User::load(1);
  $user->roles[] = 'administrator';
  $user->save();

  // Enable the admin theme.
  \Drupal::configFactory()->getEditable('node.settings')->set('use_admin_theme', TRUE)->save(TRUE);
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc