TYPO3 CMS
TYPO3_6-2
Main Page
Related Pages
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
+
Files
File List
+
File Members
+
All
$
(
_
a
c
d
e
f
h
i
l
o
p
r
s
t
u
x
+
Functions
_
a
c
d
e
f
i
l
o
p
r
s
u
x
+
Variables
$
(
_
a
d
e
h
i
p
r
s
t
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Pages
UsernameViewHelper.php
Go to the documentation of this file.
1
<?php
2
namespace
TYPO3\CMS\Belog\ViewHelpers
;
3
22
class
UsernameViewHelper
extends
\TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
{
23
28
protected
$backendUserRepository
;
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
}
TYPO3\CMS\Belog\ViewHelpers\UsernameViewHelper\$backendUserRepository
$backendUserRepository
Definition:
UsernameViewHelper.php:28
$uid
$uid
Definition:
server.php:36
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
Definition:
AbstractViewHelper.php:19
TYPO3\CMS\Belog\ViewHelpers\UsernameViewHelper\$usernameRuntimeCache
static $usernameRuntimeCache
Definition:
UsernameViewHelper.php:35
TYPO3\CMS\Belog\ViewHelpers\UsernameViewHelper
Definition:
UsernameViewHelper.php:22
TYPO3\CMS\Belog\ViewHelpers
typo3
sysext
belog
Classes
ViewHelpers
UsernameViewHelper.php
Generated on Wed Aug 7 2019 09:52:19 for TYPO3 CMS by
1.8.13