Skip to main content
removed "Drupal" and tags from the title
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

How do iI access the configconfiguration variables present in secret.settingssettings.php through my code in Drupal8?

I want to access the variables present in the settings.php in my custom module. How do i do that.

Ex: if For example, if the settings.php has $config['test']['uid'] = 'ABC';

file contains the $config['test']['uid'] = 'ABC'; line, I want to access this variable $config['test']['uid']the content of $config['test']['uid'] in my modulea controller.

public function checkUpdates() { //fetch the variables from the settings.php

}How can I achieve this?

How do i access the config variables present in secret.settings.php through my code in Drupal8

I want to access variables present in the settings.php in my custom module. How do i do that.

Ex: if settings.php has $config['test']['uid'] = 'ABC';

I want to access this variable $config['test']['uid'] in my module controller.

public function checkUpdates() { //fetch the variables from the settings.php

}

How do I access the configuration variables present in settings.php through my code?

I want to access the variables present in the settings.php in my custom module. For example, if the settings.php file contains the $config['test']['uid'] = 'ABC'; line, I want to access the content of $config['test']['uid'] in a controller.

How can I achieve this?

Source Link

How do i access the config variables present in secret.settings.php through my code in Drupal8

I want to access variables present in the settings.php in my custom module. How do i do that.

Ex: if settings.php has $config['test']['uid'] = 'ABC';

I want to access this variable $config['test']['uid'] in my module controller.

public function checkUpdates() { //fetch the variables from the settings.php

}