[htmltmpl] Nested HTML::Template Objects Suggestion
Brought to you by:
samtregar
From: Taylor B. <tba...@he...> - 2004-06-08 18:02:45
|
Howdy, I'm a new HTML::Template and didn't find anything about this in the docs, perhaps I overlooked it, but I'm pretty sure that the functionality isn't there. I'd like to be able to nest Template objects so it's a little easier to manage the dynamics of the templates used. I wrote a quick module that would tie a HTML::Template object to my class and when it is FETCH'ed, it calls the output() method. This could be more easily done with the following alteration to HTML::Template: #current lines 2608-2610 elsif ($type eq 'HTML::Template::VAR') { defined($$line) and $result .= $$line; } #suggested change for line 2609 #this will check to see if the current line is a HTML::Template object if(defined $$line) { $result .= (ref $$line eq __PACKAGE__) ? $$line->output(): $$line #UNIVERSAL::isa($$line,__PACKAGE__) could be used, too } Is it possible to get this change in the next version of HTML::Template? :) -- Taylor Basilio |