public static File::preRenderFile($element)
Prepares a #type 'file' render element for input.html.twig.
For assistance with handling the uploaded file correctly, see the API provided by file.inc.
array $element: An associative array containing the properties of the element. Properties used: #title, #name, #size, #description, #required, #attributes.
array The $element with prepared variables ready for input.html.twig.
public static function preRenderFile($element) { $element['#attributes']['type'] = 'file'; Element::setAttributes($element, array('id', 'name', 'size')); static::setAttributes($element, array('js-form-file', 'form-file')); return $element; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Element!File.php/function/File::preRenderFile/8.1.x