TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
FormViewHelper Class Reference
Inheritance diagram for FormViewHelper:
AbstractFormViewHelper AbstractTagBasedViewHelper AbstractViewHelper FormViewHelper

Public Member Functions

 injectHashService (\TYPO3\CMS\Extbase\Security\Cryptography\HashService $hashService)
 
 injectMvcPropertyMappingConfigurationService (\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService $mvcPropertyMappingConfigurationService)
 
 injectExtensionService (\TYPO3\CMS\Extbase\Service\ExtensionService $extensionService)
 
 initializeArguments ()
 
 render ()
 
- Public Member Functions inherited from AbstractFormViewHelper
 injectPersistenceManager (\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager)
 
- Public Member Functions inherited from AbstractTagBasedViewHelper
 __construct ()
 
 initializeArguments ()
 
 initialize ()
 
- Public Member Functions inherited from AbstractViewHelper
 setRenderingContext (\TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 prepareArguments ()
 

Protected Member Functions

 setFormActionUri ()
 
 renderAdditionalIdentityFields ()
 
 renderHiddenReferrerFields ()
 
 addFormObjectNameToViewHelperVariableContainer ()
 
 removeFormObjectNameFromViewHelperVariableContainer ()
 
 getFormObjectName ()
 
 addFormObjectToViewHelperVariableContainer ()
 
 removeFormObjectFromViewHelperVariableContainer ()
 
 addFieldNamePrefixToViewHelperVariableContainer ()
 
 getFieldNamePrefix ()
 
 removeFieldNamePrefixFromViewHelperVariableContainer ()
 
 addFormFieldNamesToViewHelperVariableContainer ()
 
 removeFormFieldNamesFromViewHelperVariableContainer ()
 
 renderRequestHashField ()
 
 postProcessUriArgumentsForRequestHash ($arguments, &$results, $currentPrefix= '', $level=0)
 
 getDefaultFieldNamePrefix ()
 
 removeCheckboxFieldNamesFromViewHelperVariableContainer ()
 
 renderTrustedPropertiesField ()
 
- Protected Member Functions inherited from AbstractFormViewHelper
 prefixFieldName ($fieldName)
 
 renderHiddenIdentityField ($object, $name)
 
 registerFieldNameForFormTokenGeneration ($fieldName)
 
- Protected Member Functions inherited from AbstractTagBasedViewHelper
 registerTagAttribute ($name, $type, $description, $required=false, $default=null)
 
 registerUniversalTagAttributes ()
 
- Protected Member Functions inherited from AbstractViewHelper
 callRenderMethod ()
 
 getLogger ()
 
 registerRenderMethodArguments ()
 

Protected Attributes

 $tagName = 'form'
 
 $hashService
 
 $mvcPropertyMappingConfigurationService
 
 $extensionService
 
 $formActionUriArguments
 
- Protected Attributes inherited from AbstractFormViewHelper
 $persistenceManager
 
- Protected Attributes inherited from AbstractTagBasedViewHelper
 $tagName = 'div'
 
 $tag
 
 $escapeOutput = false
 
- Protected Attributes inherited from AbstractViewHelper
 $controllerContext
 
 $objectManager
 

Detailed Description

Form view helper. Generates a <form> Tag.

= Basic usage =

Use <f:form> to output an HTML <form> tag which is targeted at the specified action, in the current controller and package. It will submit the form data via a POST request. If you want to change this, use method="get" as an argument. <f:form action="...">...</f:form>

= A complex form with a specified encoding type =

<f:form action=".." controller="..." package="..." enctype="multipart/form-data">...</f:form>

= A Form which should render a domain object =

<f:form action="..." name="customer" object="{customer}"> <f:form.hidden property="id" /> <f:form.textbox property="name" /> </f:form> This automatically inserts the value of {customer.name} inside the textbox and adjusts the name of the textbox accordingly.

Definition at line 44 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Member Function Documentation

addFieldNamePrefixToViewHelperVariableContainer ( )
protected

Adds the field name prefix to the ViewHelperVariableContainer

Definition at line 329 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

References FormViewHelper\getFieldNamePrefix().

Referenced by FormViewHelper\render().

addFormFieldNamesToViewHelperVariableContainer ( )
protected

Adds a container for form field names to the ViewHelperVariableContainer

Definition at line 360 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\render().

addFormObjectNameToViewHelperVariableContainer ( )
protected

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

Definition at line 267 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

References FormViewHelper\getFormObjectName().

Referenced by FormViewHelper\render().

addFormObjectToViewHelperVariableContainer ( )
protected

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

Definition at line 307 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\render().

getDefaultFieldNamePrefix ( )
protected

Retrieves the default field name prefix for this form

Returns
string default field name prefix

Definition at line 412 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\getFieldNamePrefix().

getFormObjectName ( )
protected

Returns the name of the object that is bound to this form. 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.

Returns
string specified Form name or NULL if neither $objectName nor $name arguments have been specified

Definition at line 293 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\addFormObjectNameToViewHelperVariableContainer(), FormViewHelper\removeFormObjectNameFromViewHelperVariableContainer(), and FormViewHelper\render().

injectExtensionService ( \TYPO3\CMS\Extbase\Service\ExtensionService  $extensionService)
Parameters
\TYPO3\CMS\Extbase\Service\ExtensionService$extensionService

Definition at line 93 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

References FormViewHelper\$extensionService.

injectHashService ( \TYPO3\CMS\Extbase\Security\Cryptography\HashService  $hashService)
Parameters
\TYPO3\CMS\Extbase\Security\Cryptography\HashService$hashService

Definition at line 77 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

References FormViewHelper\$hashService.

injectMvcPropertyMappingConfigurationService ( \TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService  $mvcPropertyMappingConfigurationService)
Parameters
\TYPO3\CMS\Extbase\Mvc\Controller\MvcPropertyMappingConfigurationService$mvcPropertyMappingConfigurationService

Definition at line 85 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

References FormViewHelper\$mvcPropertyMappingConfigurationService.

postProcessUriArgumentsForRequestHash (   $arguments,
$results,
  $currentPrefix = '',
  $level = 0 
)
protected

Add the URI arguments after postprocessing to the request hash as well.

Definition at line 393 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\renderRequestHashField().

removeCheckboxFieldNamesFromViewHelperVariableContainer ( )
protected

Remove Checkbox field names from ViewHelper variable container, to start from scratch when a new form starts.

Definition at line 435 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\render().

removeFieldNamePrefixFromViewHelperVariableContainer ( )
protected

Removes field name prefix from the ViewHelperVariableContainer

Definition at line 352 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\render().

removeFormFieldNamesFromViewHelperVariableContainer ( )
protected

Removes the container for form field names from the ViewHelperVariableContainer

Definition at line 368 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\render().

removeFormObjectFromViewHelperVariableContainer ( )
protected

Removes the form object from the ViewHelperVariableContainer.

Definition at line 318 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\render().

removeFormObjectNameFromViewHelperVariableContainer ( )
protected

Removes the form name from the ViewHelperVariableContainer.

Definition at line 278 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

References FormViewHelper\getFormObjectName().

Referenced by FormViewHelper\render().

renderAdditionalIdentityFields ( )
protected

Render additional identity fields which were registered by form elements. This happens if a form field is defined like property="bla.blubb" - then we might need an identity property for the sub-object "bla".

Returns
string HTML-string for the additional identity properties

Definition at line 217 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\render().

renderHiddenReferrerFields ( )
protected

Renders hidden form fields for referrer information about the current controller and action.

Returns
string Hidden fields with referrer information
Todo:
filter out referrer information that is equal to the target (e.g. same packageKey)

Definition at line 237 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

References AbstractFormViewHelper\prefixFieldName().

Referenced by FormViewHelper\render().

renderRequestHashField ( )
protected
renderTrustedPropertiesField ( )
protected

Render the request hash field

Returns
string The hmac field

Definition at line 447 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

References FormViewHelper\getFieldNamePrefix(), and AbstractFormViewHelper\prefixFieldName().

Referenced by FormViewHelper\render().

setFormActionUri ( )
protected

Sets the "action" attribute of the form tag

Definition at line 179 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

Referenced by FormViewHelper\render().

Member Data Documentation

$extensionService
protected
$formActionUriArguments
protected

Definition at line 72 of file fluid/Classes/ViewHelpers/FormViewHelper.php.

$hashService
protected
$mvcPropertyMappingConfigurationService
protected
$tagName = 'form'
protected

Definition at line 49 of file fluid/Classes/ViewHelpers/FormViewHelper.php.