Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Rose::DB and HTML Template

by moritz (Cardinal)
on Mar 01, 2011 at 09:56 UTC ( [id://890710]=note: print w/replies, xml ) Need Help??


in reply to Rose::DB and HTML Template

Looking at the documentation of Rose::DB::Object::Manager it seems that the get_$thing methods already return array references.

But since HTML::Template can't call methods, you have to turn each object into a hash reference first. So for example:

my $cars = YourClass->get_classes; $cars = [map {; {name => $_->name, manufacturer => $_->manufacturer } +}, @$cars]; $template->param(cars => $cars);

(I'm not really familiar with RDOM, so take this with a grain of salt).

Of course it kinda defeats the purpose of an object-relation mapper to first construct objects, and then turn them into dumb hashes...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://890710]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-18 23:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found