Dear folks!
Sorry for untested code in prev. post!
Special Thanks to Stefan Seifert <[EMAIL PROTECTED]>!
Here it is corrected one:
I've got a lot of job with refactoring of old procedural script to new
OO ones. The end is near, and job not fear, but I'm trying to implement
a so called "Composite view" pattern in Perl. Here it is a "Facade" influence too:
our $templ_path = 'foo/bar/etc'
sub composite_view
{
my ( $template,$data) = @_;
my $logo_links = logo_links();
my $navigate_bar = navigate_bar();
my $footer_html = footer_html();
my $tmpl = '';
my $content = '';
$tmpl = new HTML::Template( filename =>
"$templ_path/templates/anemon.$template.tmpl" );
$tmpl->param( data=>$data ) if $data;
$content = $tmpl->output;
$tmpl = new HTML::Template( filename =>
"$templ_path/templates/anemon.composite_view.tmpl" );
$tmpl->param(
content=>$content,logo_links=>$logo_links,navigate_bar=>$navigate_bar,footer_html=>$footer_html
);
header_html();
print $tmpl->output;
}
This sub works fine, but there are two instances of H::T class. May be it
will be profitable to all of us to create a method for example
'filename' to change Template filename?
What are your opinions?
--
Sweetest regards,
Sergey Velikanov mailto:[EMAIL PROTECTED]
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users