【问题标题】:CakePHP 2.1 - AuthComponent::user() only gives me ID, Email, Password (hashed)CakePHP 2.1 - AuthComponent::user() 只给我 ID、电子邮件、密码(散列)
【发布时间】:2012-03-06 16:01:45
【问题描述】:

我正在尝试使用AuthComponent::user('first_name') 访问用户的名字并将其显示在视图中。如果我这样做debug(AuthComponent::user());,我看到我只能访问当前登录用户的 ID、电子邮件和密码,但不能访问他的姓名等。

我必须指定用户登录时哪些用户数据可用还是应该自动发生?

【问题讨论】:

    标签: cakephp authentication cakephp-2.1


    【解决方案1】:

    会话在 $this->Auth->login() 调用中填充。 您提交给此方法的所有内容都存储在会话中。

    另见 API: http://api20.cakephp.org/class/auth-component#method-AuthComponentlogin

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-30
    • 1970-01-01
    • 2012-07-15
    • 2012-07-23
    • 2011-12-15
    • 1970-01-01
    • 2015-04-25
    • 2012-06-03
    相关资源
    最近更新 更多