How to organize Catalyst stashby roman (Monk)
|on Nov 18, 2010 at 10:25 UTC||Need Help??|
roman has asked for the
wisdom of the Perl Monks concerning the following question:
I wonder how the fellowmonks pass their model objects into templates. Do you pass directly the objects or do you expand them into individual properties (pass them as hashrefs)?
If you use the first method (objects) how do you pass the additional information for the object?
Let us say we need to display a list of some kind of payments (DBIx::Class objects). It could be comfortable just:
But there are other information we need to supply with each payment:
So would you pass the list like this:
or would you pass just the payments and compute the additional info (and URLs) in template (It doesn't seem very MVCish to me)?
Finally how do you pass dates? As objects or formatted already?
Any comments are really appreciated.