PHP Class Neos\FluidAdaptor\ViewHelpers\Form\UploadViewHelper

Make sure to set enctype="multipart/form-data" on the form! If a file has been uploaded successfully and the form is re-displayed due to validation errors, this ViewHelper will render hidden fields that contain the previously generated resource so you won't have to upload the file again. You can use a separate ViewHelper to display previously uploaded resources in order to remove/replace them. = Examples =
Inheritance: extends AbstractFormFieldViewHelper
Show file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$propertyMapper Neos\Flow\Property\PropertyMapper
$tagName string

Public Methods

Method Description
initializeArguments ( ) : void
render ( ) : string Renders the upload field.

Protected Methods

Method Description
getNameWithoutPrefix ( ) : string Get the name of this form element, without prefix.
getUploadedResource ( ) : PersistentResource Returns a previously uploaded resource, or the resource specified via "value" argument if no resource has been uploaded before If errors occurred during property mapping for this property, NULL is returned

Method Details

getNameWithoutPrefix() protected method

Note: This is overridden here because the "value" argument should not have an effect on the name attribute of the tag In the original implementation, setting a value will influence the name, @see AbstractFormFieldViewHelper::getNameWithoutPrefix()
protected getNameWithoutPrefix ( ) : string
return string name

getUploadedResource() protected method

Returns a previously uploaded resource, or the resource specified via "value" argument if no resource has been uploaded before If errors occurred during property mapping for this property, NULL is returned
protected getUploadedResource ( ) : PersistentResource
return Neos\Flow\ResourceManagement\PersistentResource or NULL if no resource was uploaded and the "value" argument is not set

initializeArguments() public method

public initializeArguments ( ) : void
return void

render() public method

Renders the upload field.
public render ( ) : string
return string

Property Details

$propertyMapper protected property

protected PropertyMapper,Neos\Flow\Property $propertyMapper
return Neos\Flow\Property\PropertyMapper

$tagName protected property

protected string $tagName
return string