小编Muh*_*aha的帖子

Nette getUser在组件中

我不得不问如何将已登录用户的名称输入Nette组件(SomethingControl.php).显然我不能这样做:

    $identity = $this->getUser()->getIdentity();
    if ($identity) $this->template->username = $identity->getData()['username'];
Run Code Online (Sandbox Code Playgroud)

所以我试过这个:

$this->template->username = $this->user
Run Code Online (Sandbox Code Playgroud)

但这也不起作用.

php components username nette

2
推荐指数
1
解决办法
379
查看次数

标签 统计

components ×1

nette ×1

php ×1

username ×1