Configuration storage

Configuration is essentially stored in two places--the database (by default, the active configuration storage, and YAML files (the true source of the configuration).

Here is an example of a simple configuration YAML file:

my_string: 'Hello!'my_int: 10my_boolean: truemy_array: my_deep_string: 'Yes, hello!'

The name of this file is given by the ID you need to use with the configuration API to read this data.

In addition to the actual data, you can have a dependencies key under which you can list what this configuration item depends on:

dependencies:  module:    - views  theme:    - bootstrap  config:    - system.site

There are three types of dependencies--modules, themes, and other configuration items.

If you remember in Chapter 2 ...

Get Drupal 8 Module Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.