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
Afficher le fichier Open project: neos/flow-development-collection Class Usage Examples

Méthodes publiques

Méthode Description
initializeArguments ( ) : void

Méthodes protégées

Méthode 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 méthode

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

getLastSubmittedFormData() protected méthode

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
Résultat mixed

getMappingResultsForProperty() protected méthode

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

getName() protected méthode

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
Résultat string Name

getNameWithoutPrefix() protected méthode

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

getPropertyPath() protected méthode

For this will be ".foo.bar" For this will be "foo.bar.baz"
protected getPropertyPath ( ) : string
Résultat string

getPropertyValue() protected méthode

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

getRequest() protected méthode

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

getValue() protected méthode

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
Résultat mixed Value

getValueAttribute() protected méthode

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)
Résultat mixed Value

hasMappingErrorOccured() protected méthode

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

hasMappingErrorOccurred() protected méthode

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

initializeArguments() public méthode

public initializeArguments ( ) : void
Résultat void

isObjectAccessorMode() protected méthode

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

renderHiddenFieldForEmptyValue() protected méthode

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
Résultat void

setErrorClassAttribute() protected méthode

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