FormViewHelper
class FormViewHelper extends AbstractFormViewHelper (View source)
Used to output an HTML
Properties
protected ControllerContext
$controllerContext
Controller Context to use
from
AbstractViewHelper
protected ObjectManagerInterface
$objectManager
from
AbstractViewHelper
protected LoggerInterface
$logger
from
AbstractViewHelper
protected bool
$escapeOutput
Disable escaping of tag based ViewHelpers so that the rendered tag is not htmlspecialchar'd
from
AbstractTagBasedViewHelper
protected TagBuilder
$tag
Tag builder instance
from
AbstractTagBasedViewHelper
protected string
$tagName
protected PersistenceManagerInterface
$persistenceManager
from
AbstractFormViewHelper
protected HashService
$hashService
protected Context
$securityContext
protected MvcPropertyMappingConfigurationService
$mvcPropertyMappingConfigurationService
protected AuthenticationManagerInterface
$authenticationManager
protected string
$formActionUri
Methods
void
setRenderingContext(RenderingContextInterface $renderingContext)
No description
from
AbstractViewHelper
void
from
AbstractViewHelper
void
injectLogger(LoggerInterface $logger)
Injects the (system) logger based on PSR-3.
from
AbstractViewHelper
void
registerTagAttribute(string $name, string $type, string $description, bool $required = false, mixed $defaultValue = null)
Register a new tag attribute. Tag attributes are all arguments which will be directly appended to a tag if you call $this->initializeTag()
void
registerUniversalTagAttributes()
Registers all standard HTML universal attributes.
void
handleAdditionalArguments(array $arguments)
Handles additional arguments, sorting out any data-
prefixed tag attributes and assigning them. Then passes
the unassigned arguments to the parent class' method,
which in the default implementation will throw an error
about "undeclared argument used".
void
injectPersistenceManager(PersistenceManagerInterface $persistenceManager)
Injects the Flow Persistence Manager
string
prefixFieldName(string $fieldName)
Prefixes / namespaces the given name with the form field prefix
string
renderHiddenIdentityField(object $object, string $name)
Renders a hidden form field containing the technical identity of the given object.
void
registerFieldNameForFormTokenGeneration(string $fieldName)
Register a field name for inclusion in the HMAC / Form Token generation
void
initializeArguments()
Initialize arguments.
string
render()
Render the form.
string
getFormActionUri()
Returns the action URI of the form tag.
string
renderHiddenActionUriQueryParameters()
Render hidden form fields for query parameters from action URI.
string
renderAdditionalIdentityFields()
Render additional identity fields which were registered by form elements.
string
renderHiddenReferrerFields()
Renders hidden form fields for referrer information about
the current controller and action.
void
addFormObjectNameToViewHelperVariableContainer()
Adds the form object name to the ViewHelperVariableContainer if "objectName" argument or "name" attribute is specified.
void
removeFormObjectNameFromViewHelperVariableContainer()
Removes the form object name from the ViewHelperVariableContainer.
string
getFormObjectName()
Returns the name of the object that is bound to this form.
void
addFormObjectToViewHelperVariableContainer()
Adds the object that is bound to this form to the ViewHelperVariableContainer if the formObject attribute is specified.
void
removeFormObjectFromViewHelperVariableContainer()
Removes the form object from the ViewHelperVariableContainer.
void
addFieldNamePrefixToViewHelperVariableContainer()
Adds the field name prefix to the ViewHelperVariableContainer
string
getFieldNamePrefix()
Get the field name prefix
string
getDefaultFieldNamePrefix()
Retrieves the default field name prefix for this form
void
removeFieldNamePrefixFromViewHelperVariableContainer()
Removes field name prefix from the ViewHelperVariableContainer
void
addFormFieldNamesToViewHelperVariableContainer()
Adds a container for form field names to the ViewHelperVariableContainer
void
removeFormFieldNamesFromViewHelperVariableContainer()
Removes the container for form field names from the ViewHelperVariableContainer
void
addEmptyHiddenFieldNamesToViewHelperVariableContainer()
Adds a container for rendered hidden field names for empty values to the ViewHelperVariableContainer
void
removeEmptyHiddenFieldNamesFromViewHelperVariableContainer()
Removes container for rendered hidden field names for empty values from ViewHelperVariableContainer
string
renderEmptyHiddenFields()
Renders all empty hidden fields that have been added to ViewHelperVariableContainer
string
renderTrustedPropertiesField()
Render the request hash field
string
renderCsrfTokenField()
Render the a hidden field with a CSRF token
Details
void
setRenderingContext(RenderingContextInterface $renderingContext)
No description
void
injectObjectManager(ObjectManagerInterface $objectManager)
No description
void
injectLogger(LoggerInterface $logger)
Injects the (system) logger based on PSR-3.
bool
isEscapingInterceptorEnabled()
No description
__construct()
Constructor
void
injectTagBuilder(TagBuilder $tag)
No description
void
initialize()
Sets the tag name to $this->tagName.
Additionally, sets all tag attributes which were registered in
$this->tagAttributes and additionalArguments.
Will be invoked just before the render method.
protected void
registerTagAttribute(string $name, string $type, string $description, bool $required = false, mixed $defaultValue = null)
Register a new tag attribute. Tag attributes are all arguments which will be directly appended to a tag if you call $this->initializeTag()
protected void
registerUniversalTagAttributes()
Registers all standard HTML universal attributes.
Should be used inside registerArguments();
void
handleAdditionalArguments(array $arguments)
Handles additional arguments, sorting out any data-
prefixed tag attributes and assigning them. Then passes
the unassigned arguments to the parent class' method,
which in the default implementation will throw an error
about "undeclared argument used".
void
injectPersistenceManager(PersistenceManagerInterface $persistenceManager)
Injects the Flow Persistence Manager
protected string
prefixFieldName(string $fieldName)
Prefixes / namespaces the given name with the form field prefix
protected string
renderHiddenIdentityField(object $object, string $name)
Renders a hidden form field containing the technical identity of the given object.
protected void
registerFieldNameForFormTokenGeneration(string $fieldName)
Register a field name for inclusion in the HMAC / Form Token generation
void
initializeArguments()
Initialize arguments.
string
render()
Render the form.
protected string
getFormActionUri()
Returns the action URI of the form tag.
If the argument "actionUri" is specified, this will be returned
Otherwise this creates the action URI using the UriBuilder
protected string
renderHiddenActionUriQueryParameters()
Render hidden form fields for query parameters from action URI.
This is only needed if the form method is GET.
protected string
renderAdditionalIdentityFields()
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".
protected string
renderHiddenReferrerFields()
Renders hidden form fields for referrer information about
the current controller and action.
filter
out referrer information that is equal to the target (e.g. same packageKey)
protected void
addFormObjectNameToViewHelperVariableContainer()
Adds the form object name to the ViewHelperVariableContainer if "objectName" argument or "name" attribute is specified.
protected void
removeFormObjectNameFromViewHelperVariableContainer()
Removes the form object name from the ViewHelperVariableContainer.
protected string
getFormObjectName()
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.
protected void
addFormObjectToViewHelperVariableContainer()
Adds the object that is bound to this form to the ViewHelperVariableContainer if the formObject attribute is specified.
protected void
removeFormObjectFromViewHelperVariableContainer()
Removes the form object from the ViewHelperVariableContainer.
protected void
addFieldNamePrefixToViewHelperVariableContainer()
Adds the field name prefix to the ViewHelperVariableContainer
protected string
getFieldNamePrefix()
Get the field name prefix
protected string
getDefaultFieldNamePrefix()
Retrieves the default field name prefix for this form
protected void
removeFieldNamePrefixFromViewHelperVariableContainer()
Removes field name prefix from the ViewHelperVariableContainer
protected void
addFormFieldNamesToViewHelperVariableContainer()
Adds a container for form field names to the ViewHelperVariableContainer
protected void
removeFormFieldNamesFromViewHelperVariableContainer()
Removes the container for form field names from the ViewHelperVariableContainer
protected void
addEmptyHiddenFieldNamesToViewHelperVariableContainer()
Adds a container for rendered hidden field names for empty values to the ViewHelperVariableContainer
protected void
removeEmptyHiddenFieldNamesFromViewHelperVariableContainer()
Removes container for rendered hidden field names for empty values from ViewHelperVariableContainer
protected string
renderEmptyHiddenFields()
Renders all empty hidden fields that have been added to ViewHelperVariableContainer
protected string
renderTrustedPropertiesField()
Render the request hash field
protected string
renderCsrfTokenField()
Render the a hidden field with a CSRF token