FormViewHelper extends FormViewHelper
This class is the implementation of a Fluid ViewHelper.
View this class in the TYPO3 ViewHelper reference: <formvh:form>
Custom form ViewHelper that renders the form state instead of referrer fields
Scope: frontend
Table of Contents
Properties
- $configurationManager : ConfigurationManagerInterface
- $extensionService : ExtensionService
- $formActionUriArguments : array<string|int, mixed>
- We need the arguments of the formActionUri on request hash calculation therefore we will store them in here right after calling uriBuilder
- $hashService : HashService
- $mvcPropertyMappingConfigurationService : MvcPropertyMappingConfigurationService
- $persistenceManager : PersistenceManagerInterface
- $tagName : string
Methods
- initializeArguments() : void
- injectConfigurationManager() : void
- injectExtensionService() : void
- injectHashService() : void
- injectMvcPropertyMappingConfigurationService() : void
- injectPersistenceManager() : void
- render() : string
- addFieldNamePrefixToViewHelperVariableContainer() : void
- Adds the field name prefix to the ViewHelperVariableContainer.
- addFormFieldNamesToViewHelperVariableContainer() : void
- Adds a container for form field names to the ViewHelperVariableContainer.
- addFormObjectNameToViewHelperVariableContainer() : void
- Adds the form object name to the ViewHelperVariableContainer if "objectName" argument or "name" attribute is specified.
- addFormObjectToViewHelperVariableContainer() : void
- Adds the object that is bound to this form to the ViewHelperVariableContainer if the formObject attribute is specified.
- createHiddenInputElement() : string
- getDefaultFieldNamePrefix() : string
- Retrieves the default field name prefix for this form
- getFieldNamePrefix() : string
- getFormObjectName() : string
- We do NOT return NULL as in this case, the Form ViewHelpers do not enter $objectAccessorMode.
- getFormRuntime() : FormRuntime
- prefixFieldName() : string
- Prefixes / namespaces the given name with the form field prefix
- registerFieldNameForFormTokenGeneration() : void
- Register a field name for inclusion in the HMAC / Form Token generation
- removeCheckboxFieldNamesFromViewHelperVariableContainer() : void
- Remove Checkbox field names from ViewHelper variable container, to start from scratch when a new form starts.
- removeFieldNamePrefixFromViewHelperVariableContainer() : void
- Removes field name prefix from the ViewHelperVariableContainer.
- removeFormFieldNamesFromViewHelperVariableContainer() : void
- Removes the container for form field names from the ViewHelperVariableContainer.
- removeFormObjectFromViewHelperVariableContainer() : void
- Removes the form object from the ViewHelperVariableContainer.
- removeFormObjectNameFromViewHelperVariableContainer() : void
- Removes the form name from the ViewHelperVariableContainer.
- renderAdditionalIdentityFields() : string
- Render additional identity fields which were registered by form elements.
- renderHiddenIdentityField() : string
- Renders a hidden form field containing the technical identity of the given object.
- renderHiddenReferrerFields() : string
- Renders hidden form fields for referrer information about the current request.
- renderRequestTokenHiddenField() : string
- renderTrustedPropertiesField() : string
- Render the request hash field
- setFormActionUri() : void
- Sets the "action" attribute of the form tag
Properties
$configurationManager
protected
ConfigurationManagerInterface
$configurationManager
$extensionService
protected
ExtensionService
$extensionService
$formActionUriArguments
We need the arguments of the formActionUri on request hash calculation therefore we will store them in here right after calling uriBuilder
protected
array<string|int, mixed>
$formActionUriArguments
= []
$hashService
protected
HashService
$hashService
$mvcPropertyMappingConfigurationService
protected
MvcPropertyMappingConfigurationService
$mvcPropertyMappingConfigurationService
$persistenceManager
protected
PersistenceManagerInterface
$persistenceManager
$tagName
protected
string
$tagName
= 'form'
Methods
initializeArguments()
public
initializeArguments() : void
injectConfigurationManager()
public
injectConfigurationManager(ConfigurationManagerInterface $configurationManager) : void
Parameters
- $configurationManager : ConfigurationManagerInterface
injectExtensionService()
public
injectExtensionService(ExtensionService $extensionService) : void
Parameters
- $extensionService : ExtensionService
injectHashService()
public
injectHashService(HashService $hashService) : void
Parameters
- $hashService : HashService
injectMvcPropertyMappingConfigurationService()
public
injectMvcPropertyMappingConfigurationService(MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService) : void
Parameters
- $mvcPropertyMappingConfigurationService : MvcPropertyMappingConfigurationService
injectPersistenceManager()
public
injectPersistenceManager(PersistenceManagerInterface $persistenceManager) : void
Parameters
- $persistenceManager : PersistenceManagerInterface
render()
public
render() : string
Return values
stringaddFieldNamePrefixToViewHelperVariableContainer()
Adds the field name prefix to the ViewHelperVariableContainer.
protected
addFieldNamePrefixToViewHelperVariableContainer() : void
addFormFieldNamesToViewHelperVariableContainer()
Adds a container for form field names to the ViewHelperVariableContainer.
protected
addFormFieldNamesToViewHelperVariableContainer() : void
addFormObjectNameToViewHelperVariableContainer()
Adds the form object name to the ViewHelperVariableContainer if "objectName" argument or "name" attribute is specified.
protected
addFormObjectNameToViewHelperVariableContainer() : void
addFormObjectToViewHelperVariableContainer()
Adds the object that is bound to this form to the ViewHelperVariableContainer if the formObject attribute is specified.
protected
addFormObjectToViewHelperVariableContainer() : void
createHiddenInputElement()
protected
createHiddenInputElement(string $name, string $value) : string
Parameters
- $name : string
- $value : string
Return values
stringgetDefaultFieldNamePrefix()
Retrieves the default field name prefix for this form
protected
getDefaultFieldNamePrefix() : string
Return values
stringgetFieldNamePrefix()
protected
getFieldNamePrefix() : string
Return values
stringgetFormObjectName()
We do NOT return NULL as in this case, the Form ViewHelpers do not enter $objectAccessorMode.
protected
getFormObjectName() : string
However, we return the form identifier.
Return values
string —specified Form name or NULL if neither $objectName nor $name arguments have been specified
getFormRuntime()
protected
getFormRuntime() : FormRuntime
Return values
FormRuntimeprefixFieldName()
Prefixes / namespaces the given name with the form field prefix
protected
prefixFieldName(string $fieldName) : string
Parameters
- $fieldName : string
Return values
stringregisterFieldNameForFormTokenGeneration()
Register a field name for inclusion in the HMAC / Form Token generation
protected
registerFieldNameForFormTokenGeneration(string $fieldName) : void
Parameters
- $fieldName : string
removeCheckboxFieldNamesFromViewHelperVariableContainer()
Remove Checkbox field names from ViewHelper variable container, to start from scratch when a new form starts.
protected
removeCheckboxFieldNamesFromViewHelperVariableContainer() : void
removeFieldNamePrefixFromViewHelperVariableContainer()
Removes field name prefix from the ViewHelperVariableContainer.
protected
removeFieldNamePrefixFromViewHelperVariableContainer() : void
removeFormFieldNamesFromViewHelperVariableContainer()
Removes the container for form field names from the ViewHelperVariableContainer.
protected
removeFormFieldNamesFromViewHelperVariableContainer() : void
removeFormObjectFromViewHelperVariableContainer()
Removes the form object from the ViewHelperVariableContainer.
protected
removeFormObjectFromViewHelperVariableContainer() : void
removeFormObjectNameFromViewHelperVariableContainer()
Removes the form name from the ViewHelperVariableContainer.
protected
removeFormObjectNameFromViewHelperVariableContainer() : void
renderAdditionalIdentityFields()
Render additional identity fields which were registered by form elements.
protected
renderAdditionalIdentityFields() : string
This happens if a form field is defined like property="bla.blubb" - then we might need an identity property for the sub-object "bla".
Return values
string —HTML-string for the additional identity properties
renderHiddenIdentityField()
Renders a hidden form field containing the technical identity of the given object.
protected
renderHiddenIdentityField(mixed $object, string|null $name) : string
Parameters
- $object : mixed
-
Object to create the identity field for. Non-objects are ignored.
- $name : string|null
-
Name
Tags
Return values
string —A hidden field containing the Identity (uid) of the given object
renderHiddenReferrerFields()
Renders hidden form fields for referrer information about the current request.
protected
renderHiddenReferrerFields() : string
Return values
string —Hidden fields with referrer information
renderRequestTokenHiddenField()
protected
renderRequestTokenHiddenField() : string
Return values
stringrenderTrustedPropertiesField()
Render the request hash field
protected
renderTrustedPropertiesField() : string
Return values
stringsetFormActionUri()
Sets the "action" attribute of the form tag
protected
setFormActionUri() : void