WebTechKitchen; Your Web Technology Kitchen, contact us to create, or maintain your websites and other digital properties.

Putting variables in settings.php in Drupal 8

Submitted by barnettech on Mon, 08/30/2021 - 09:27

In your settings.php:

$settings['foo'] = 'bar';

In your code:

use Drupal\Core\Site\Settings;

Settings::get('foo', 'mydefaultvalue');