PHP Class Neos\FluidAdaptor\ViewHelpers\FormViewHelper

= Examples = ...
...
...
...
...
...
A form where the value of {customer.name} is automatically inserted inside the textbox; the name of the textbox is set to match the property name.
Inheritance: extends Neos\FluidAdaptor\ViewHelpers\Form\AbstractFormViewHelper
Exibir arquivo Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$authenticationManager Neos\Flow\Security\Authentication\AuthenticationManagerInterface
$formActionUri string
$hashService Neos\Flow\Security\Cryptography\HashService
$mvcPropertyMappingConfigurationService Neos\Flow\Mvc\Controller\MvcPropertyMappingConfigurationService
$securityContext Neos\Flow\Security\Context
$tagName string

Public Methods

Method Description
initializeArguments ( ) : void Initialize arguments.
render ( string $action = null, array $arguments = [], string $controller = null, string $package = null, string $subpackage = null, mixed $object = null, string $section = '', string $format = '', array $additionalParams = [], boolean $absolute = false, boolean $addQueryString = false, array $argumentsToBeExcludedFromQueryString = [], string $fieldNamePrefix = null, string $actionUri = null, string $objectName = null, boolean $useParentRequest = false ) : string Render the form.

Protected Methods

Method Description
addEmptyHiddenFieldNamesToViewHelperVariableContainer ( ) : void Adds a container for rendered hidden field names for empty values to the ViewHelperVariableContainer
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.
getDefaultFieldNamePrefix ( ) : string Retrieves the default field name prefix for this form
getFieldNamePrefix ( ) : string Get the field name prefix
getFormActionUri ( ) : string Returns the action URI of the form tag.
getFormObjectName ( ) : string Returns the name of the object that is bound to this form.
removeEmptyHiddenFieldNamesFromViewHelperVariableContainer ( ) : void Removes container for rendered hidden field names for empty values from ViewHelperVariableContainer
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 object name from the ViewHelperVariableContainer.
renderAdditionalIdentityFields ( ) : string Render additional identity fields which were registered by form elements.
renderCsrfTokenField ( ) : string Render the a hidden field with a CSRF token
renderEmptyHiddenFields ( ) : string Renders all empty hidden fields that have been added to ViewHelperVariableContainer
renderHiddenActionUriQueryParameters ( ) : string Render hidden form fields for query parameters from action URI.
renderHiddenReferrerFields ( ) : string Renders hidden form fields for referrer information about the current controller and action.
renderTrustedPropertiesField ( ) : string Render the request hash field

Method Details

addEmptyHiddenFieldNamesToViewHelperVariableContainer() protected method

Adds a container for rendered hidden field names for empty values to the ViewHelperVariableContainer
See also: Neos\FluidAdaptor\ViewHelpers\Form\AbstractFormFieldViewHelper::renderHiddenFieldForEmptyValue()

addFieldNamePrefixToViewHelperVariableContainer() protected method

Adds the field name prefix to the ViewHelperVariableContainer

addFormFieldNamesToViewHelperVariableContainer() protected method

Adds a container for form field names to the ViewHelperVariableContainer

addFormObjectNameToViewHelperVariableContainer() protected method

Adds the form object name to the ViewHelperVariableContainer if "objectName" argument or "name" attribute is specified.

addFormObjectToViewHelperVariableContainer() protected method

Adds the object that is bound to this form to the ViewHelperVariableContainer if the formObject attribute is specified.

getDefaultFieldNamePrefix() protected method

Retrieves the default field name prefix for this form
protected getDefaultFieldNamePrefix ( ) : string
return string default field name prefix

getFieldNamePrefix() protected method

Get the field name prefix
protected getFieldNamePrefix ( ) : string
return string

getFormActionUri() protected method

If the argument "actionUri" is specified, this will be returned Otherwise this creates the action URI using the UriBuilder
protected getFormActionUri ( ) : string
return string

getFormObjectName() protected method

If the "objectName" argument has been specified, this is returned. Otherwise the name attribute of this form. If neither objectName nor name arguments have been set, NULL is returned.
protected getFormObjectName ( ) : string
return string specified Form name or NULL if neither $objectName nor $name arguments have been specified

initializeArguments() public method

Initialize arguments.
public initializeArguments ( ) : void
return void

removeEmptyHiddenFieldNamesFromViewHelperVariableContainer() protected method

Removes container for rendered hidden field names for empty values from ViewHelperVariableContainer
See also: Neos\FluidAdaptor\ViewHelpers\Form\AbstractFormFieldViewHelper::renderHiddenFieldForEmptyValue()

removeFieldNamePrefixFromViewHelperVariableContainer() protected method

Removes field name prefix from the ViewHelperVariableContainer

removeFormFieldNamesFromViewHelperVariableContainer() protected method

Removes the container for form field names from the ViewHelperVariableContainer

removeFormObjectFromViewHelperVariableContainer() protected method

Removes the form object from the ViewHelperVariableContainer.

removeFormObjectNameFromViewHelperVariableContainer() protected method

Removes the form object name from the ViewHelperVariableContainer.

render() public method

Render the form.
public render ( string $action = null, array $arguments = [], string $controller = null, string $package = null, string $subpackage = null, mixed $object = null, string $section = '', string $format = '', array $additionalParams = [], boolean $absolute = false, boolean $addQueryString = false, array $argumentsToBeExcludedFromQueryString = [], string $fieldNamePrefix = null, string $actionUri = null, string $objectName = null, boolean $useParentRequest = false ) : string
$action string target action
$arguments array additional arguments
$controller string name of target controller
$package string name of target package
$subpackage string name of target subpackage
$object mixed object to use for the form. Use in conjunction with the "property" attribute on the sub tags
$section string The anchor to be added to the action URI (only active if $actionUri is not set)
$format string The requested format (e.g. ".html") of the target page (only active if $actionUri is not set)
$additionalParams array additional action URI query parameters that won't be prefixed like $arguments (overrule $arguments) (only active if $actionUri is not set)
$absolute boolean If set, an absolute action URI is rendered (only active if $actionUri is not set)
$addQueryString boolean If set, the current query parameters will be kept in the action URI (only active if $actionUri is not set)
$argumentsToBeExcludedFromQueryString array arguments to be removed from the action URI. Only active if $addQueryString = TRUE and $actionUri is not set
$fieldNamePrefix string Prefix that will be added to all field names within this form
$actionUri string can be used to overwrite the "action" attribute of the form tag
$objectName string name of the object that is bound to this form. If this argument is not specified, the name attribute of this form is used to determine the FormObjectName
$useParentRequest boolean If set, the parent Request will be used instead ob the current one
return string rendered form

renderAdditionalIdentityFields() protected method

This happens if a form field is defined like property="bla.blubb" - then we might need an identity property for the sub-object "bla".
protected renderAdditionalIdentityFields ( ) : string
return string HTML-string for the additional identity properties

renderCsrfTokenField() protected method

Render the a hidden field with a CSRF token
protected renderCsrfTokenField ( ) : string
return string the CSRF token field

renderEmptyHiddenFields() protected method

Renders all empty hidden fields that have been added to ViewHelperVariableContainer
See also: Neos\FluidAdaptor\ViewHelpers\Form\AbstractFormFieldViewHelper::renderHiddenFieldForEmptyValue()
protected renderEmptyHiddenFields ( ) : string
return string

renderHiddenActionUriQueryParameters() protected method

This is only needed if the form method is GET.
protected renderHiddenActionUriQueryParameters ( ) : string
return string Hidden fields for query parameters from action URI

renderHiddenReferrerFields() protected method

Renders hidden form fields for referrer information about the current controller and action.
protected renderHiddenReferrerFields ( ) : string
return string Hidden fields with referrer information

renderTrustedPropertiesField() protected method

Render the request hash field
protected renderTrustedPropertiesField ( ) : string
return string the hmac field

Property Details

$authenticationManager protected_oe property

protected AuthenticationManagerInterface,Neos\Flow\Security\Authentication $authenticationManager
return Neos\Flow\Security\Authentication\AuthenticationManagerInterface

$formActionUri protected_oe property

protected string $formActionUri
return string

$hashService protected_oe property

protected HashService,Neos\Flow\Security\Cryptography $hashService
return Neos\Flow\Security\Cryptography\HashService

$mvcPropertyMappingConfigurationService protected_oe property

protected MvcPropertyMappingConfigurationService,Neos\Flow\Mvc\Controller $mvcPropertyMappingConfigurationService
return Neos\Flow\Mvc\Controller\MvcPropertyMappingConfigurationService

$securityContext protected_oe property

protected Context,Neos\Flow\Security $securityContext
return Neos\Flow\Security\Context

$tagName protected_oe property

protected string $tagName
return string