O'Reilly logo

Drupal 8 Module Development by Daniel Sipos

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required