Zend_Auth 没有提供所有信息
我在 Zend 和 Doctrine 方面遇到了这个问题,我希望有人能帮助我理解我做错了什么:-
我的登录控制器如下:
....
if ($result->isValid()) {
$session = new Zend_Session_Namespace('tcc.auth');
$identity = $adapter->getResultArray('password');
$auth->getStorage()->write($identity);
.....
在我的索引控制器调度中,我调用了
$session = new Zend_Session_Namespace('tcc.auth');
不起作用的内容,因为我希望的是,如果我这样做:
print_r (Zend_Auth::getInstance()->getIdentity());
我正确地获取了所有数组,如果我只想获取 ie userid 并执行此操作:
Zend_Auth::getInstance()->getIdentity()->userid;
我什么也得不到。它只是空的!
我对自己做错了什么感到困惑。有人可以帮忙吗?
I am having this issue with Zend and Doctrine and I am hoping someone can help me understand what I am doing wrong:-
My login controller is as follow:
....
if ($result->isValid()) {
$session = new Zend_Session_Namespace('tcc.auth');
$identity = $adapter->getResultArray('password');
$auth->getStorage()->write($identity);
.....
In my index controller dispatch I call
$session = new Zend_Session_Namespace('tcc.auth');
what is not working as I hoped is that if I do this:
print_r (Zend_Auth::getInstance()->getIdentity());
I get the all Array correctly, bit if I want to get ie userid only and do this:
Zend_Auth::getInstance()->getIdentity()->userid;
I get nothing. It is just empty!
I am puzzled about what I am doing wrong. Can someone please please help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许我错了,但如果它是一个数组,这不是检索它的正确方法吗?
希望有帮助,
Maybe I'm mistaken, but if it's an array, wouldn't this be the proper way to retrieve it?
Hope that helps,