TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
FormElementInterface Interface Reference
Inheritance diagram for FormElementInterface:
RenderableInterface RootRenderableInterface AbstractFormElement Section UnknownFormElement AdvancedPassword DatePicker FileUpload GenericFormElement

Public Member Functions

 initializeFormElement ()
 
 getUniqueIdentifier ()
 
 getDefaultValue ()
 
 setDefaultValue ($defaultValue)
 
 setProperty (string $key, $value)
 
 getProperties ()
 
 setRenderingOption (string $key, $value)
 
 getValidators ()
 
 addValidator (ValidatorInterface $validator)
 
 setDataType (string $dataType)
 
 isRequired ()
 
 onSubmit (FormRuntime $formRuntime, &$elementValue, array $requestArguments=[])
 
- Public Member Functions inherited from RenderableInterface
 getParentRenderable ()
 
 setParentRenderable (CompositeRenderableInterface $renderable)
 
 setIndex (int $index)
 
 getIndex ()
 
 onRemoveFromParentRenderable ()
 
 onBuildingFinished ()
 
 registerInFormIfPossible ()
 
- Public Member Functions inherited from RootRenderableInterface
 getType ()
 
 getIdentifier ()
 
 getLabel ()
 
 beforeRendering (FormRuntime $formRuntime)
 
 getRendererClassName ()
 
 getRenderingOptions ()
 

Detailed Description

A base form element interface, which can be the starting point for creating custom (PHP-based) Form Elements.

A FormElement is a part of a Page, which in turn is part of a FormDefinition. See FormDefinition for an in-depth explanation.

Often, you should rather subclass AbstractFormElement instead of implementing this interface.

Scope: frontend

Definition at line 34 of file FormElementInterface.php.

Member Function Documentation

addValidator ( ValidatorInterface  $validator)

Registers a validator for this element

Parameters
ValidatorInterface$validator
Returns
void

Implemented in Section.

getDefaultValue ( )

Get the default value with which the Form Element should be initialized during display.

Returns
mixed the default value for this Form Element

Implemented in AbstractFormElement, UnknownFormElement, and Section.

getProperties ( )

Get all element-specific configuration properties

Returns
array

Implemented in AbstractFormElement, UnknownFormElement, and Section.

Referenced by RenderAllFormValuesViewHelper\processElementValue(), and RenderAllFormValuesViewHelper\processObject().

getUniqueIdentifier ( )

Returns a unique identifier of this element. While element identifiers are only unique within one form, this includes the identifier of the form itself, making it "globally" unique

Returns
string the "globally" unique identifier of this element

Implemented in AbstractFormElement, Section, and UnknownFormElement.

getValidators ( )

Returns the child validators of the ConjunctionValidator that is registered for this element

Returns
<ValidatorInterface>

Implemented in Section.

Referenced by AbstractFormElement\isRequired().

initializeFormElement ( )

Will be called as soon as the element is (tried to be) added to a form

See also
registerInFormIfPossible()
Returns
void

Implemented in UnknownFormElement, AbstractFormElement, Section, FileUpload, and DatePicker.

isRequired ( )

Whether or not this element is required

Returns
bool

Implemented in Section, UnknownFormElement, and AbstractFormElement.

onSubmit ( FormRuntime  $formRuntime,
$elementValue,
array  $requestArguments = [] 
)

This callback is invoked by the FormRuntime whenever values are mapped and validated (after a form page was submitted)

Parameters
FormRuntime$formRuntime
mixed$elementValuesubmitted value of the element before post processing
array$requestArgumentssubmitted raw request values
Returns
void
See also
FormRuntime::mapAndValidate()

Implemented in AbstractFormElement, UnknownFormElement, and AdvancedPassword.

setDataType ( string  $dataType)

Set the target data type for this element

Parameters
string$dataTypethe target data type
Returns
void

Referenced by DatePicker\initializeFormElement(), and FileUpload\initializeFormElement().

setDefaultValue (   $defaultValue)

Set the default value with which the Form Element should be initialized during display.

Parameters
mixed$defaultValuethe default value for this Form Element

Implemented in AbstractFormElement, UnknownFormElement, and Section.

setProperty ( string  $key,
  $value 
)

Set an element-specific configuration property.

Parameters
string$key
mixed$value
Returns
void

Implemented in AbstractFormElement, UnknownFormElement, and Section.

setRenderingOption ( string  $key,
  $value 
)

Set a rendering option

Parameters
string$key
mixed$value

Implemented in Section.