1 user.module user_view($account, $view_mode = 'full', $langcode = NULL)

Generate an array for rendering the given user.

When viewing a user profile, the $page array contains:

  • $page['content']['user_picture']: User's rendered picture.
  • $page['content']['member_for']: Contains the default "Member for" profile data for a user.
  • $page['content']['#account']: The user account of the profile being viewed.

To theme user profiles, copy modules/user/user-profile.tpl.php to your theme directory, and edit it as instructed in that file's comments.

Parameters

$account: A user object.

$view_mode: (optional) Display mode, e.g. 'full' or 'teaser'. Defaults to 'full'.

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

Return value

An array as expected by backdrop_render().:

File

core/modules/user/user.module, line 2392
Enables the user registration and login system.

Code

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