Re: [htmltmpl] RFC: Objects in templates
Brought to you by:
samtregar
From: Timm M. <tm...@ag...> - 2004-06-02 17:49:10
|
At 10:26 PM 6/2/04 +0530, Philip Tellis wrote: >Sometime Today, michael assembled some asciibets to say: > > > I was wanting to use Class::DBI to Model my data and H::T to View it. > > When I do this I end up with a lot of code that looks like this > > > > $tmpl->param( > > ObjAtt1 => $obj->att1, > > ObjAtt2 => $obj->att2, > > ObjAtt3 => $obj->att3, > > ObjAtt4 => $obj->att4, > > ObjAtt5 => $obj->att5, > > ); > >Just implement the param() method and include your object in the >associate list to new. Simple as that. <> That doesn't solve things on the template end: <TMPL_VAR obj.attr1> Which gets into how to define a more structured namespace convention than the flat one currently used by HTML::Template. |