You are here

public static function SocialAuthController::setLoginButtonSettings in Social Auth 8.2

Same name and namespace in other branches
  1. 8 src/Controller/SocialAuthController.php \Drupal\social_auth\Controller\SocialAuthController::setLoginButtonSettings()
  2. 3.x src/Controller/SocialAuthController.php \Drupal\social_auth\Controller\SocialAuthController::setLoginButtonSettings()

Sets the settings for the login button for the given social networking.

Parameters

string $module: The module machine name.

string $route: The route name of the user authentication controller.

string $img_path: The path of the image for login.

File

src/Controller/SocialAuthController.php, line 22

Class

SocialAuthController
Manages login buttons settings and integration table renderization.

Namespace

Drupal\social_auth\Controller

Code

public static function setLoginButtonSettings($module, $route, $img_path) {
  $config = \Drupal::configFactory()
    ->getEditable('social_auth.settings');
  $img_path = drupal_get_path('module', $module) . '/' . $img_path;
  $config
    ->set('auth.' . $module . '.route', $route)
    ->set('auth.' . $module . '.img_path', $img_path)
    ->save();
}