FAQ
I am trying to display display information about the user currently logged
into my catalyst app but for some reason it is returning blank (or even
null). I am trying to display the uniqid (user id) and username of the
current user. From my template I am calling [% c.user.object.username %]
and [% c.user.object.uniqid %] respectively. I know that my authentication
is working because the "$c->user_exists()" calls in my controller is
passing.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110417/c0e576d7/attachment.htm

Search Discussions

  • John M. Dlugosz at Apr 18, 2011 at 1:23 am

    On 4/17/2011 8:14 PM, Adam Jimerson vendion-at-gmail.com |Catalyst/Allow to home| wrote:
    I am trying to display display information about the user currently logged
    into my catalyst app but for some reason it is returning blank (or even
    null). I am trying to display the uniqid (user id) and username of the
    current user. From my template I am calling [% c.user.object.username %]
    and [% c.user.object.uniqid %] respectively. I know that my authentication
    is working because the "$c->user_exists()" calls in my controller is
    passing.
    The first thing I would try is "DUMP"ing the c.user.object to see if it's what you expect.
    I've had blankness in templates where things were really objects, not strings; or
    perhaps the name is wrong.
  • Octavian Rasnita at Apr 18, 2011 at 5:18 am
    From: Adam Jimerson
    I am trying to display display information about the user currently logged into my catalyst app but for some reason it is returning blank (or even null). I am trying to display the uniqid (user id) and username of the current user. From my template I am calling [% c.user.object.username %] and [% c.user.object.uniqid %] respectively. I know that my authentication is working because the "$c->user_exists()" calls in my controller is passing.






    You need to use:



    [% c.user.get('uniqid') %]

    and

    [% c.user.get('username') %]



    The c.user object also has other methods like id() and get_object() that might help you.



    Octavian.






    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20110418/c4b2dfe1/attachment.htm
  • Adam Jimerson at Apr 19, 2011 at 12:30 am

    Octavian Rasnita wrote:
    From: Adam Jimerson
    I am trying to display display information about the user currently logged into my catalyst app but for some reason it is returning blank (or even null). I am trying to display the uniqid (user id) and username of the current user. From my template I am calling [% c.user.object.username %] and [% c.user.object.uniqid %] respectively. I know that my authentication is working because the "$c->user_exists()" calls in my controller is passing.






    You need to use:



    [% c.user.get('uniqid') %]

    and

    [% c.user.get('username') %]



    The c.user object also has other methods like id() and get_object() that might help you.



    Octavian.
    Thank you very much for the help.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedApr 18, '11 at 1:14a
activeApr 19, '11 at 12:30a
posts4
users3
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase