Advanced usage

Last updated on
13 June 2020

There are several ways to extend Component Schema to cover advanced use cases.

Custom data types

Like Drupal core's configuration schema API, Component Schema supports providing custom data types through a schema file. Custom types can be freestanding or can extend existing types. See the documentation on types supported in the Drupal core configuration schema API for relevant documentation.

To provide a custom type, add it to a module in the location component/schema/modulename.schema.yml. See the file component/schema/component_schema.types.yml for an example.

Altering components

Components are provided in a storage that can be altered in an event subscriber. Component Schema provides a ComponentSchemaStorageEvents::TRANSFORM_COLLECT event parallel to Drupal core's ConfigEvents::STORAGE_TRANSFORM_IMPORT; see also StorageTransformEvent.

Help improve this page

Page status: No known problems

You can: