TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
AbstractRenderable Class Reference
Inheritance diagram for AbstractRenderable:
RenderableInterface RootRenderableInterface AbstractFormElement UnknownFormElement AbstractCompositeRenderable AdvancedPassword DatePicker FileUpload GenericFormElement FormDefinition AbstractSection Page Section

Public Member Functions

 getType ()
 
 getIdentifier ()
 
 setOptions (array $options)
 
 createValidator (string $validatorIdentifier, array $options=[])
 
 addValidator (ValidatorInterface $validator)
 
 getValidators ()
 
 setDataType (string $dataType)
 
 setRendererClassName (string $rendererClassName)
 
 getRendererClassName ()
 
 getRenderingOptions ()
 
 setRenderingOption (string $key, $value)
 
 getParentRenderable ()
 
 setParentRenderable (CompositeRenderableInterface $parentRenderable)
 
 getRootForm ()
 
 registerInFormIfPossible ()
 
 onRemoveFromParentRenderable ()
 
 getIndex ()
 
 setIndex (int $index)
 
 getLabel ()
 
 setLabel (string $label)
 
 beforeRendering (FormRuntime $formRuntime)
 
 onBuildingFinished ()
 

Protected Attributes

 $type
 
 $identifier
 
 $parentRenderable
 
 $label = ''
 
 $renderingOptions = []
 
 $rendererClassName = null
 
 $index = 0
 

Detailed Description

Convenience base class which implements common functionality for most classes which implement RenderableInterface.

Scope: frontend This class is NOT meant to be sub classed by developers.

Definition at line 35 of file AbstractRenderable.php.

Member Function Documentation

addValidator ( ValidatorInterface  $validator)

Add a validator to the element

Parameters
ValidatorInterface$validator
Returns
void

Definition at line 202 of file AbstractRenderable.php.

References AbstractRenderable\getIdentifier(), and AbstractRenderable\getRootForm().

Referenced by AbstractRenderable\createValidator().

beforeRendering ( FormRuntime  $formRuntime)

Override this method in your custom Renderable if needed

Parameters
FormRuntime$formRuntime
Returns
void

Implements RootRenderableInterface.

Definition at line 409 of file AbstractRenderable.php.

createValidator ( string  $validatorIdentifier,
array  $options = [] 
)

Create a validator for the element

Parameters
string$validatorIdentifier
array$options
Returns
mixed
Exceptions
ValidatorPresetNotFoundException

Definition at line 177 of file AbstractRenderable.php.

References AbstractRenderable\addValidator(), AbstractRenderable\getRootForm(), GeneralUtility\makeInstance(), and ArrayUtility\mergeRecursiveWithOverrule().

Referenced by AbstractRenderable\setOptions().

getIndex ( )

Get the index of the renderable

Returns
int

Implements RenderableInterface.

Definition at line 362 of file AbstractRenderable.php.

References AbstractRenderable\$index.

getLabel ( )

Get the label of the renderable

Returns
string

Implements RootRenderableInterface.

Definition at line 385 of file AbstractRenderable.php.

References AbstractRenderable\$label.

getParentRenderable ( )

Get the parent renderable

Returns
null|CompositeRenderableInterface
void

Implements RenderableInterface.

Definition at line 287 of file AbstractRenderable.php.

References AbstractRenderable\$parentRenderable.

getRendererClassName ( )

Get the classname of the renderer

Returns
null|string

Implements RootRenderableInterface.

Definition at line 251 of file AbstractRenderable.php.

References AbstractRenderable\$rendererClassName.

getRenderingOptions ( )

Get all rendering options

Returns
array

Implements RootRenderableInterface.

Definition at line 262 of file AbstractRenderable.php.

References AbstractRenderable\$renderingOptions.

Referenced by AbstractRenderable\setOptions(), and FormDefinition\setOptions().

getType ( )

Get the type of the renderable

Returns
string

Implements RootRenderableInterface.

Definition at line 99 of file AbstractRenderable.php.

References AbstractRenderable\$type.

getValidators ( )

Get all validators on the element

Returns

Definition at line 214 of file AbstractRenderable.php.

References AbstractRenderable\getIdentifier(), and AbstractRenderable\getRootForm().

onBuildingFinished ( )

This is a callback that is invoked by the Form Factory after the whole form has been built. It can be used to add new form elements as children for complex form elements.

Override this method in your custom Renderable if needed.

Returns
void

Implements RenderableInterface.

Definition at line 422 of file AbstractRenderable.php.

onRemoveFromParentRenderable ( )

Triggered when the renderable is removed from it's parent

Returns
void

Implements RenderableInterface.

Definition at line 346 of file AbstractRenderable.php.

References AbstractRenderable\getRootForm().

registerInFormIfPossible ( )

Register this element at the parent form, if there is a connection to the parent form.

Returns
void

Implements RenderableInterface.

Definition at line 331 of file AbstractRenderable.php.

References AbstractRenderable\getRootForm().

Referenced by AbstractRenderable\setParentRenderable().

setDataType ( string  $dataType)

Set the datatype

Parameters
string$dataType
Returns
void

Definition at line 227 of file AbstractRenderable.php.

References AbstractRenderable\getIdentifier(), and AbstractRenderable\getRootForm().

setIndex ( int  $index)

Set the index of the renderable

Parameters
int$index
Returns
void

Implements RenderableInterface.

Definition at line 374 of file AbstractRenderable.php.

References AbstractRenderable\$index.

setLabel ( string  $label)

Set the label which shall be displayed next to the form element

Parameters
string$label
Returns
void

Definition at line 397 of file AbstractRenderable.php.

References AbstractRenderable\$label.

Referenced by AbstractRenderable\setOptions().

setOptions ( array  $options)

Set multiple properties of this object at once. Every property which has a corresponding set* method can be set using the passed $options array.

Parameters
array$options
Returns
void

Definition at line 124 of file AbstractRenderable.php.

References ArrayUtility\assertAllArrayKeysAreValid(), AbstractRenderable\createValidator(), AbstractRenderable\getRenderingOptions(), ArrayUtility\mergeRecursiveWithOverrule(), AbstractRenderable\setLabel(), AbstractRenderable\setRendererClassName(), and AbstractRenderable\setRenderingOption().

setParentRenderable ( CompositeRenderableInterface  $parentRenderable)

Set the parent renderable

Parameters
CompositeRenderableInterface$parentRenderable
Returns
void

Implements RenderableInterface.

Definition at line 299 of file AbstractRenderable.php.

References AbstractRenderable\$parentRenderable, and AbstractRenderable\registerInFormIfPossible().

setRendererClassName ( string  $rendererClassName)

Set the renderer class name

Parameters
string$rendererClassName
Returns
void

Definition at line 240 of file AbstractRenderable.php.

References AbstractRenderable\$rendererClassName.

Referenced by AbstractRenderable\setOptions(), and FormDefinition\setOptions().

setRenderingOption ( string  $key,
  $value 
)

Set the rendering option $key to $value.

Parameters
string$key
mixed$value
Returns
mixed

Definition at line 275 of file AbstractRenderable.php.

Referenced by AbstractRenderable\setOptions(), and FormDefinition\setOptions().

Member Data Documentation

$index = 0
protected
$label = ''
protected
$rendererClassName = null
protected
$renderingOptions = []
protected

Definition at line 73 of file AbstractRenderable.php.

Referenced by AbstractRenderable\getRenderingOptions().