PHP Class Neos\FluidAdaptor\ViewHelpers\Form\AbstractFormFieldViewHelper

If you set the "property" attribute to the name of the property to resolve from the object, this class will automatically set the name and value of a form element.
Inheritance: extends AbstractFormViewHelper
Show file Open project: neos/flow-development-collection Class Usage Examples

Public Methods

Method Description
initializeArguments ( ) : void

Protected Methods

Method Description
addAdditionalIdentityPropertiesIfNeeded ( ) : void Add additional identity properties in case the current property is hierarchical (of the form "bla.blubb").
getLastSubmittedFormData ( ) : mixed Get the form data which has last been submitted; only returns valid data in case a property mapping error has occurred. Check with hasMappingErrorOccurred() before!
getMappingResultsForProperty ( ) : Neos\Error\Messages\Result Get errors for the property and form name of this view helper
getName ( ) : string Get the name of this form element.
getNameWithoutPrefix ( ) : string Get the name of this form element, without prefix.
getPropertyPath ( ) : string Returns the "absolute" property path of the property bound to this ViewHelper.
getPropertyValue ( ) : mixed Get the current property of the object bound to this form.
getRequest ( ) : ActionRequest Shortcut for retrieving the request from the controller context
getValue ( boolean $convertObjects = true ) : mixed Get the value of this form element.
getValueAttribute ( boolean $ignoreSubmittedFormData = false ) : mixed Returns the current value of this Form ViewHelper and converts it to an identifier string in case it's an object The value is determined as follows: * If property mapping errors occurred and the form is re-displayed, the *last submitted* value is returned * Else the bound property is returned (only in objectAccessor-mode) * As fallback the "value" argument of this ViewHelper is used
hasMappingErrorOccured ( ) : boolean
hasMappingErrorOccurred ( ) : boolean Checks if a property mapping error has occurred in the last request.
isObjectAccessorMode ( ) : boolean Internal method which checks if we should evaluate a domain object or just output arguments['name'] and arguments['value']
renderHiddenFieldForEmptyValue ( ) : void Renders a hidden field with the same name as the element, to make sure the empty value is submitted in case nothing is selected. This is needed for checkbox and multiple select fields
setErrorClassAttribute ( ) : void Add an CSS class if this view helper has errors

Method Details

addAdditionalIdentityPropertiesIfNeeded() protected method

Then, [bla][__identity] has to be generated as well.

getLastSubmittedFormData() protected method

Get the form data which has last been submitted; only returns valid data in case a property mapping error has occurred. Check with hasMappingErrorOccurred() before!
protected getLastSubmittedFormData ( ) : mixed
return mixed

getMappingResultsForProperty() protected method

Get errors for the property and form name of this view helper
protected getMappingResultsForProperty ( ) : Neos\Error\Messages\Result
return Neos\Error\Messages\Result

getName() protected method

Either returns arguments['name'], or the correct name for Object Access. In case property is something like bla.blubb (hierarchical), then [bla][blubb] is generated.
protected getName ( ) : string
return string Name

getNameWithoutPrefix() protected method

Get the name of this form element, without prefix.
protected getNameWithoutPrefix ( ) : string
return string name

getPropertyPath() protected method

For this will be ".foo.bar" For this will be "foo.bar.baz"
protected getPropertyPath ( ) : string
return string

getPropertyValue() protected method

Get the current property of the object bound to this form.
protected getPropertyValue ( ) : mixed
return mixed Value

getRequest() protected method

Shortcut for retrieving the request from the controller context
protected getRequest ( ) : ActionRequest
return Neos\Flow\Mvc\ActionRequest

getValue() protected method

Either returns arguments['value'], or the correct value for Object Access.
Deprecation: since Flow 3.0. Use getValueAttribute() and (if applicable) addAdditionalIdentityPropertiesIfNeeded()
protected getValue ( boolean $convertObjects = true ) : mixed
$convertObjects boolean whether or not to convert objects to identifiers
return mixed Value

getValueAttribute() protected method

Returns the current value of this Form ViewHelper and converts it to an identifier string in case it's an object The value is determined as follows: * If property mapping errors occurred and the form is re-displayed, the *last submitted* value is returned * Else the bound property is returned (only in objectAccessor-mode) * As fallback the "value" argument of this ViewHelper is used
protected getValueAttribute ( boolean $ignoreSubmittedFormData = false ) : mixed
$ignoreSubmittedFormData boolean By default the submitted form value has precedence over value/property argument upon re-display. With this flag set the submitted data is not evaluated (e.g. for checkbox and hidden fields where the value attribute should not be changed)
return mixed Value

hasMappingErrorOccured() protected method

Deprecation: since 2.1 Use hasMappingErrorOccurred() instead
protected hasMappingErrorOccured ( ) : boolean
return boolean TRUE if a mapping error occurred, FALSE otherwise

hasMappingErrorOccurred() protected method

Checks if a property mapping error has occurred in the last request.
protected hasMappingErrorOccurred ( ) : boolean
return boolean TRUE if a mapping error occurred, FALSE otherwise

initializeArguments() public method

public initializeArguments ( ) : void
return void

isObjectAccessorMode() protected method

Internal method which checks if we should evaluate a domain object or just output arguments['name'] and arguments['value']
protected isObjectAccessorMode ( ) : boolean
return boolean TRUE if we should evaluate the domain object, FALSE otherwise.

renderHiddenFieldForEmptyValue() protected method

Renders a hidden field with the same name as the element, to make sure the empty value is submitted in case nothing is selected. This is needed for checkbox and multiple select fields
protected renderHiddenFieldForEmptyValue ( ) : void
return void

setErrorClassAttribute() protected method

Add an CSS class if this view helper has errors
protected setErrorClassAttribute ( ) : void
return void