Home  >  Article  >  Backend Development  >  Yii的CWebUser扩展问题

Yii的CWebUser扩展问题

WBOY
WBOYOriginal
2016-06-06 20:45:311179browse

yii中的CWebUser类是不是默认将哪些信息封装到了session中?
但是有时候需要将整个user表的信息都封装到session中间。我们该如何扩展这个CWebUser类呢?
还有一个问题,就是是不是yii框架魔术方法与反射用的特别多?感觉好多用的都是这两个技术

回复内容:

yii中的CWebUser类是不是默认将哪些信息封装到了session中?
但是有时候需要将整个user表的信息都封装到session中间。我们该如何扩展这个CWebUser类呢?
还有一个问题,就是是不是yii框架魔术方法与反射用的特别多?感觉好多用的都是这两个技术

在自己的UserIdentity类中覆盖CUserIdentity的authenticate方法,登录验证成功后,setPersistentStates把其他用户属性写到session中

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn