douzhuangxuan3268 2012-04-18 13:14
浏览 38
已采纳

Symfony 1.4:如何操作attributeHolder?

I have an Attribute called 'admin_module' in myUser attributeHoler and i want to manipulate it...but i don't even get how to access the values stored there. I know how to get AttributeHolder in an action, but I don't have a clue, how to access the values in it. Any help appreciated...thanks in advance. ;)

Edit after answers:

get:

$this->getUser()->getAttributeHolder()->set('beilagenbuchung.page', 1, 'admin_module');

set:

$this->getUser()->getAttributeHolder()->get('beilagenbuchung.page', null, 'admin_module');

Regards

Nils

  • 写回答

2条回答 默认 最新

  • dongtiao2105 2012-04-18 13:24
    关注

    Check the doc ?

    And by the way, you can see all the attribute using the web debug toolbar: config > User > attributeHolder. Key is the namespace used (if you define one).

    See also, the sfUser.class.php where the getter are to retrieve attributes.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Llama如何调用shell或者Python
  • ¥20 eclipse连接sap后代码跑出来空白
  • ¥20 谁能帮我挨个解读这个php语言编的代码什么意思?
  • ¥15 win10权限管理,限制普通用户使用删除功能
  • ¥15 minnio内存占用过大,内存没被回收(Windows环境)
  • ¥65 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案