[Catalyst] getting the ID of the user

Tobias Kremer tobias at funkreich.de
Sat Dec 30 09:55:47 GMT 2006


> > I have tried to get the id of the currently logged user, using:
> > $c->user->id
> > But it returned same thing as
> > $c->user (the username and not its ID).

> Hi Octavian,
> Assuming you are using DBIC, try:
>   $c->user->get_column('id')

Or, alternatively, you could use $c->user->obj->id (I think).

HTH,

--Tobias



More information about the Catalyst mailing list