class FormRegistry implements FormRegistryInterface

The central registry of the Form component.

Methods

__construct(array $extensions, ResolvedFormTypeFactoryInterface $resolvedTypeFactory)

No description

getType(string $name)

Returns a form type by name.

bool
hasType(string $name)

Returns whether the given form type is supported.

getTypeGuesser()

Returns the guesser responsible for guessing types.

getExtensions()

Returns the extensions loaded by the framework.

Details

at line 58
__construct(array $extensions, ResolvedFormTypeFactoryInterface $resolvedTypeFactory)

Parameters

array $extensions An array of FormExtensionInterface
ResolvedFormTypeFactoryInterface $resolvedTypeFactory The factory for resolved form types

Exceptions

UnexpectedTypeException if any extension does not implement FormExtensionInterface

at line 73
ResolvedFormTypeInterface getType(string $name)

Returns a form type by name.

This methods registers the type extensions from the form extensions.

Parameters

string $name The name of the type

Return Value

ResolvedFormTypeInterface The type

Exceptions

InvalidArgumentException if the type can not be retrieved from any extension

at line 165
bool hasType(string $name)

Returns whether the given form type is supported.

Parameters

string $name The name of the type

Return Value

bool Whether the type is supported

at line 187
FormTypeGuesserInterface|null getTypeGuesser()

Returns the guesser responsible for guessing types.

Return Value

FormTypeGuesserInterface|null

at line 209
FormExtensionInterface[] getExtensions()

Returns the extensions loaded by the framework.

Return Value

FormExtensionInterface[]