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 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用