Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 Symfony 中获取所有会话数据?
是$this->getUser()->getAttributeHolder()吗?
$this->getUser()->getAttributeHolder()
试一试:
$this->getUser()->getAttributeHolder()->getAll();
参考:sfUser.class.php & sfNamespacedParameterHolder.class.php
所有会话变量的默认命名空间是 'symfony/user/sfUser/attributes'。您可以像这样获取所有会话数据:
$this->getUser()->getAttributeHolder()->getAll('symfony/user/sfUser/attributes');