Loading
Issue #3636978: Take a #config_target form element's #title and #description from its config schema
In a form that extends ConfigFormBase, an element with a #config_target can now leave out #title and #description and get those from its key's config schema.
The text then lives in one place, so the form and the schema can't drift apart. And because the label and description move out of the form's PHP code and into its schema, other code (e.g.ECA, FlowDrop, Maestro, Tool API, etc) can describe a setting the same way the form does.
To do so, this MR introduces a new TypedConfigManagerInterface::getDefinitionForKey($config_name, $key) function that returns one key's data definition from the schema alone.
As a demo, max_age's title and description move from PerformanceForm (form) into system.schema.yml (config schema).