function user_view

Generate an array for rendering the given user.

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

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

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

Parameters

$account: A user object.

$view_mode: View mode, e.g. '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 drupal_render().

3 calls to user_view()
template_preprocess_comment in drupal/core/modules/comment/comment.module
Prepares variables for comment templates.
template_preprocess_node in drupal/core/modules/node/node.module
Prepares variables for node templates.
user_view_page in drupal/core/modules/user/user.module
Page callback wrapper for user_view().

File

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

Code

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