Hi,

I have a DBIC record object like
my $obj = $c->model("Database::Table")->find($id);

The table has very many fields and I would like to put their values in a TT template without inserting them one by one in the stash.

So I would like to create a hash ref from $obj where the name of the field is the key and the value from the table is the value in that hash, then use $c->stash($hashref).

Is it possible to create that hash (ref) from $obj, or I need to do something like

$c->stash->{obj} = $obj;

and in the template use [% obj.name1 %]... [% obj.name2 %]?

And by the way, which do you think is the recommended way?

Thank you.




Octavian


_______________________________________________
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