Wan wrote:
> hello everyone,
> 
> I use DBIx::Class in my Catalyst project.

As a note: This is _not_ a Catalyst question! Except that you access
your model via Catalyst, it is all only DBIx-Class here. DBIC has
separete documentation and a separate mailinglist.

> my $cfg = $c->model('RTDB::Config')->search({Name =>
> $c->req->param("name")})->first;
> 
> ......
> $cfg->Name;
> $cfg->Value;
> 
> I want to get a hash ref that like this
> 
> .....
> $cfg->{Name};
> $cfg->{Value};

Look at the 'get_columns' method in DBIx::Class::Row. This should be
what you're looking for.

-- 
# Robert 'phaylon' Sedlacek
# Perl 5/Catalyst Developer in Hamburg, Germany
{ EMail => ' [EMAIL PROTECTED] ', Web => ' http://474.at ' }

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to