[Catalyst] updating $c->user at runtime

Wijnand Wiersma wijnand at nedbsd.nl
Tue Feb 7 11:21:35 CET 2006


Good morning!

Op 7-feb-2006, om 8:09 heeft Yuval Kogman het volgende geschreven:

> On Tue, Feb 07, 2006 at 00:57:28 +0100, Wijnand Wiersma wrote:
>> Hi all,
>>
>> When the user has updated his profile I immediately display a  
>> summary  of his profile again.
>> In this template I use c.user.user.name etc to display the  
>> values.  But after editing the profile I get the old values there.
>> Is it possible to set $c->user again after editing? I don't want  
>> to  add a second template or duplicate code.
>
> How did you update the profile? Please paste code.
>
> You should update using $c->user->user itself - that way it should
> be up to date.

Aha, I retrieved a DBIc object from the database and updated that.

            $person = $c->model('DBIC')->table('person')->search(
               username => $c->user->user->username(),
            );
           $person->update($valid_results);

Is it possible to do something this quick with $c->user->user ?

Wijnand



More information about the Catalyst mailing list