让 zend auth 存储多个身份值
所以基本上当我们使用 zend auth 时,我们可以调用函数 $auth->getIdentity() 来获取当前登录用户的身份......事情是......它将返回从 setIdentity() 设置的值)身份验证期间的功能,通常类似于用户名或用户 ID...我的问题是...是否可以存储多个身份变量,例如同时存储用户名和用户 ID,以便我可以检索其中之一 向用户显示和/或传递给其他脚本的内容
提前感谢
!没有勺子
——矩阵
so basically when we use zend auth we can call function $auth->getIdentity() to get the identity of the currently logged in user....the thing is...it would return the value that was set from setIdentity() function during authentication which usually is something like username or user id....my question is.....is it possible to store multiple variables for identity for instance store both username AND user id, so that I can retrieve either one of those to display to the user and/or to pass to other script
thanks in advance!
There is no spoon
-The matrix
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您愿意,您甚至可以存储整个
user
对象。它实际上是将东西写入会话中:You can even store the entire
user
object if you wish. It's practically writing stuff into session: