[Catalyst] Where to put common functions & how to get user id
Andreas Marienborg
omega at palle.net
Tue May 27 10:13:21 BST 2008
On May 27, 2008, at 10:21 AM, jakac wrote:
>
> Andrew Rodland wrote:
>> Create a model for the log (it could be a C::M::DBIC::Schema, your
>> own custom class, or something else) and then you can $c-
>> >model('ActionLog')->logaction($userid, $action) assuming an
>> appropriate logaction method.
>>
>>
> Thanks for the hint! I will take a look at it...
>
>> $c->user->get("user_id") etc. which is part of the universal
>> authentication interface. The DBIC store also provides $c->user-
>> >obj returns the underlying object directly, but you probably don't
>> need that. There are examples in perldoc
>> Catalyst::Plugin::Authentication.
>>
>>
>
> Doesn't work for me ...
>
> $c->log->debug("username: -".$c->user->id."- users ID -" .
> $c->user->get("user_id") ."-");
is user_id the name of your ID column in your schema (if your using
the DBIC store)?
get('column_name') is the syntax I think
- andreas
More information about the Catalyst
mailing list