1 file.module file_view($file, $view_mode = 'full', $langcode = NULL)

Generate an array for rendering the given file.


object $file: A file object.

string $view_mode: View mode.

string $langcode: (optional) A language code to use for rendering. Defaults to the global content language of the current request.

Return value

array: An array as expected by backdrop_render().


core/modules/file/file.module, line 3254
Defines a "managed_file" Form API field and a "file" field for Field module.


function file_view($file, $view_mode = 'full', $langcode = NULL) {
  return $file->view($view_mode, $langcode);