SettingsControls
Corex\Config\Settings\SettingsControls · class · Config layer
The control for each type of settings field, shared by the Settings pages and option pages (spec 032, spec 060 M6, spec 119). Every control says what its stored value is (data-corex-saved), so the page can tell an unsaved change from a saved value and put it back (US-SET-01). A field locked by the site’s .env or the network shows the value in force, cannot be edited, and says where it is set (US-SET-02). An on/off field is a switch (US-SET-09). A secret is never drawn back, and one with a stored value can be removed (US-SET-15). Every value is escaped where it is written.
Public API
Section titled “Public API”control(string $key, array $field, FieldState $state, bool $readOnly): string
Section titled “control(string $key, array $field, FieldState $state, bool $readOnly): string”nameOf(string $key): string
Section titled “nameOf(string $key): string”The name a field has in the form: its key with dots as underscores.
chosen(array $options, string $value): string
Section titled “chosen(array $options, string $value): string”The choice a select shows for a value: the value when it is one of the choices, the first choice otherwise, as a browser draws it.