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

Generate an array for rendering the given file.

Parameters

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().

File

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

Code

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