Re: [htmltmpl] RFC: Objects in templates
Brought to you by:
samtregar
From: Sam T. <sa...@tr...> - 2004-06-02 17:14:08
|
On Wed, 2 Jun 2004, michael wrote: > And then the accompanying tmpl_vars in the templates. I was thinking about > using something similar to the way Template Toolkit handles it where I can > just specify an object and then have H::T pull the attributes (or methods) as > needed. Something like this... > > $tmpl->param(Obj => $obj); > > and then in the template have > > <tmpl_var name="Obj->att1"> <tmpl_var name="Obj->att2">... etc I think it would be really easy to do this kind of thing in a sub-class. Just override param() to look for objects and turn them into a set of "obj->attr" params. I wouldn't use it but I bet some people would. -sam |