我在CakePHP的2.x的 中,auth-componentent挣扎书上说here这(最后一次是在底部入口)
$this->Auth->user();
回报所有用户数据,如果参数为null。
"$key (string) – The user data key you want to fetch.
If null, all user data will be returned."
但是,如果我回声出$u
$u = $this->Auth->user();
则仅会显示用户ID。我期待整个用户数组。有任何想法吗?从用户表
var_dump($ this-> Auth-> user()); say? –
你是指'$ u = $ this-> Auth'? – Cilan
var_dump $ this-> Auth-> user()); string(2)“21”。它是id,而不是数组。 – FishWave