Tailor\Classes\FieldManager


Protected Properties

protected array $customFields

customFields stored in the form of ['FieldClass' => $fieldInfo].

protected array $customFieldCallbacks

customFieldCallbacks cache of form widget registration callbacks.

protected array $customFieldHints

customFieldHints keyed by their code/alias.

protected PluginManager $pluginManager


Public Methods

public __construct()

public __construct(): void

__construct this singleton.

public static instance()

public static instance(): static 

instance creates a new instance of this singleton

public listCustomFields()

public listCustomFields(): array 

listCustomFields returns a list of registered content fields.

public makeField()

public makeField($name, $config = ]): [Tailor\Classes\ContentFieldBase 

makeField makes a custom field or returns a fallback one.

public makeFieldset()

public makeFieldset($config = ]): [Tailor\Classes\Fieldset 

makeFieldset will add fields to the fieldset based on supplied config

public registerCustomField()

public registerCustomField($className, $fieldInfo = null): void 

registerCustomField registers a form field.

public registerCustomFields()

public registerCustomFields($definitions): void

registerCustomFields manually registers form widget for consideration. Usage:

FieldManager::registerCustomFields(function ($manager) {
    $manager->registerCustomField(\Tailor\ContentFields\Entries::class, 'entries');
});

public resolveCustomField()

public resolveCustomField($name): string 

resolveCustomField returns a class name from a custom field code/alias

Protected Methods

protected convertExternalConfigForColumn()

protected convertExternalConfigForColumn($field, $config): void

convertExternalConfig

protected convertExternalConfigForScope()

protected convertExternalConfigForScope($field, $config): void

convertExternalConfig

protected convertExternalConfigForValidation()

protected convertExternalConfigForValidation($field, $config, $fieldName): void

protected getCustomFieldClassName()

protected getCustomFieldClassName($name): string|null 

resolveCustomField returns a class name from a custom field code/alias

protected loadCustomFieldsFromArray()

protected loadCustomFieldsFromArray($fields): void

loadExtensionsFromArray helper

protected makeFallbackField()

protected makeFallbackField($name, $type): Tailor\Classes\ContentFieldBase 

protected populateFieldsetFromExternalColumns()

protected populateFieldsetFromExternalColumns($fieldset, $config): void

protected populateFieldsetFromExternalScopes()

protected populateFieldsetFromExternalScopes($fieldset, $config): void

protected populateFieldsetFromExternalValidation()

protected populateFieldsetFromExternalValidation($fieldset, $config): void

protected populateFieldsetFromMixin()

protected populateFieldsetFromMixin($fieldset, $parentField, $mixin): void 

populateFieldsetFromMixin merges the parent field with the referenced fields then mixes them in to the collection