TYPO3 CMS  TYPO3_6-2
UsernameViewHelper.php
Go to the documentation of this file.
1 <?php
3 
23 
29 
35  static protected $usernameRuntimeCache = array();
36 
43  public function render($uid) {
44  if (isset(static::$usernameRuntimeCache[$uid])) {
45  return htmlspecialchars(static::$usernameRuntimeCache[$uid]);
46  }
47 
49  $user = $this->backendUserRepository->findByUid($uid);
50  // $user may be NULL if user was deleted from DB, set it to empty string to always return a string
51  static::$usernameRuntimeCache[$uid] = ($user === NULL) ? '' : $user->getUserName();
52  return htmlspecialchars(static::$usernameRuntimeCache[$uid]);
53  }
54 
55 }
$uid
Definition: server.php:36