Re: [htmltmpl] RFC PATCH for Associating objects
Brought to you by:
samtregar
From: Sam T. <sa...@tr...> - 2005-02-11 17:01:56
|
On Fri, 11 Feb 2005, Scottsweep wrote: > I want to propose the following PATCH to > HTML::Template. This would allow objects to be > associated without the need to define a param method > (all public methods can be TMPL_VARs). This seems like a reasonable thing to want, but I think it would be better done with a wrapper object. Imagine: use HTML::Template; use Class::ParamWrapper; my $t = HTML::Template->new(filename => $foo, associate => Class::ParamWrapper->new($some_object)); Class::ParamWrapper would provide a param() method which proxies calls to the wrapped object. You can add any configuration you need to the Class::ParamWrapper->new() call. This has the benefit of not increasing the complexity of HTML::Template's associate implementation which is already pretty unmanageable. It also opens up your code to use in other contexts. -sam PS: If you want to submit a patch in the future please prepare it using 'diff -u'. |