[Catalyst] Accessing the catalyst user data from a template

Adam Jimerson vendion at gmail.com
Tue Apr 19 00:30:07 GMT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2s148ACgkQsK1mqepTLy+ivwCgiSVtr31tmtnY4x1Fim6nySyB
sxsAnA0HYkpIl0LKSmw6DLwD8xJJ+2uj
=61Tm
-----END PGP SIGNATURE-----



More information about the Catalyst mailing list