Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / consolidation / config / README.md
index 7fdf11fc92822c4613d102ab168ffbcf70b28fc1..7108cd6ec02fb76b813bf2e874a8b073f15faeb7 100644 (file)
@@ -131,6 +131,7 @@ $application->setDispatcher($eventDispatcher);
 
 
 ### Get Configuration Values
+
 If you have a configuration file that looks like this:
 ```
 a:
@@ -143,6 +144,19 @@ $value = $config->get('a.b.c');
 ```
 [dflydev/dot-access-data](https://github.com/dflydev/dot-access-data) is leveraged to provide this capability.
 
+### Interpolation
+
+Interpolation allows configuration values to be injected into a string with tokens. The tokens are used as keys that are looked up in the config object; the resulting configuration values will be used to replace the tokens in the provided string.
+
+For example, using the same configuration file shown above:
+```
+$result = $config->interpolate('The value is: {{a.b.c}}')
+```
+In this example, the `$result` string would be:
+```
+The value is: foo
+```
+
 ### Configuration Overlays
 
 Optionally, you may use the ConfigOverlay class to combine multiple configuration objects implamenting ConfigInterface into a single, prioritized configuration object. It is not necessary to use a configuration overlay; if your only goal is to merge configuration from multiple files, you may follow the example above to extend a processor with multiple configuration files, and then import the result into a single configuration object. This will cause newer configuration items to overwrite any existing values stored under the same key.