theme_file

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 – 6 theme_file($element)
7 – 8 theme_file($variables)

Returns HTML for a file upload form element.

For assistance with handling the uploaded file correctly, see the API provided by file.inc.

Parameters

$variables An associative array containing:

  • element: An associative array containing the properties of the element. Properties used: #title, #name, #size, #description, #required, #attributes.

Related topics

Code

includes/form.inc, line 3811

<?php
function theme_file($variables) {
  $element = $variables['element'];
  $element['#attributes']['type'] = 'file';
  element_set_attributes($element, array('id', 'name', 'size'));
  _form_set_class($element, array('form-file'));

  return '<input' . drupal_attributes($element['#attributes']) . ' />';
}
?>