interface FormFactory (View source)

A service which can generate a form

Constants

DEFAULT_NAME

Default form name.

Methods

public
getForm(RequestHandler $controller = null, string $name = FormFactory::DEFAULT_NAME, array $context = [])

Generates the form

public
array
getRequiredContext()

Return list of mandatory context keys

Details

Form getForm(RequestHandler $controller = null, string $name = FormFactory::DEFAULT_NAME, array $context = [])

Generates the form

Parameters

RequestHandler $controller

Parent controller

string $name
array $context

List of properties which may influence form scaffolding. E.g. 'Record' if building a form for a record. Custom factories may support more advanced parameters.

Return Value

Form

array getRequiredContext()

Return list of mandatory context keys

Return Value

array