2010年1月22日 星期五

How to add more information to Yii::app()->user

在 Yii 中,一般情況會用
$id=Yii::app()->user->id; // 取得 username

第一次在 view 裡面使用時,覺得很怪異,我要 id 怎麼取到 username (LoginID)...

以下文件說明
1) 如何把 id 取代成 table 的 id 欄位 (sequence id)
2) 如何增加 user 的欄位,如 lastLoginTime

http://www.yiiframework.com/doc/cookbook/6/

沒有留言:

張貼留言