2014-01-10 38 views
0

的Yii ::應用程序() - >用戶> isGuest拋出異常,因爲的Yii ::應用程序() - >用戶> isGuest被返回null

"Uncaught exception 'CException' with message 'Property "CWebUser.email" is not defined."

我怎樣才能解決這個問題錯誤?

+0

由於Yii的是你將需要列出您使用的確切版本的開源應用程序(原因是它可能是你正在使用的特定版本的錯誤),或許給一些上下文關於你正在嘗試做什麼以及你正在嘗試做什麼。正如這個問題所表達的那樣,很難有人爲你準確回答。 –

+0

請加你的代碼。 –

回答

1

因爲你沒有設置電子郵件。 在「保護 - >組件 - > UserIdentity.php」處打開文件。如下所示添加$this->setState('email', $user->email)

$this->_id=$user->id; 
$this->username=$user->username; 
$this->setState('email', $user->email); 
相關問題