]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/Us.pm
Make all generators inherit from a common base
[gruntmaster-page.git] / lib / Gruntmaster / Page / Us.pm
index 2c87916aa7075f99ec4c4596f1edd9861ef457ac..2095fd55aaf0963b1511b60bdaa0b394d4712b26 100644 (file)
@@ -3,29 +3,21 @@ package Gruntmaster::Page::Us;
 use 5.014000;
 use strict;
 use warnings;
-use parent qw/Exporter/;
-our @EXPORT_OK = qw/generate/;
+use Gruntmaster::Page::Base us => 'Users';
+our @ISA = qw/Gruntmaster::Page::Base/;
 our $VERSION = '0.001';
 
-use HTML::Template::Compiled;
-use Gruntmaster::Data qw/users user_name/;
-use Gruntmaster::Page::Common qw/cook_templates reload_templates/;
-
-my %orig_templates = (
+use constant TEMPLATES => {
        en => <<'HTML',
 <ul><tmpl_loop users><li><a href="<tmpl_var id>.var"><tmpl_var name></a>
 </tmpl_loop></ul>
 HTML
-);
-
-my %templates = cook_templates %orig_templates, us => 'Users';
+};
 
-sub generate{
-       %templates = cook_templates %orig_templates, us => 'Users' if reload_templates;
-       my $htc = HTML::Template::Compiled->new(scalarref => \$templates{$_[1]});
+sub _generate{
+       my ($self, $htc, $path, $lang) = @_;
 
        $htc->param(users => [ map { {id => $_, name => user_name} } users ]);
-       $htc->output;
 }
 
 1
This page took 0.026127 seconds and 4 git commands to generate.