I have an admin setting form (Configuration form) called 'example.settings'. I can load the configuration using below code.

$config = \Drupal::config('example.settings');

Is there a way to iterate through and get all the configuration values in this config object


You could try the following to get the raw values back:


E.g. the following

$config = \Drupal::config('system.maintenance');

Returns and array of something like: 'message' => string(93) "@site is currently under maintenance. We should be back shortly. Thank you for y…" 'langcode' => "en" →'_core' => array(1)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.