]> iEval git - gruntmaster-page.git/blame - lib/Gruntmaster/Page/Index.pm
Centralize template cooking and introduce reloadable templates
[gruntmaster-page.git] / lib / Gruntmaster / Page / Index.pm
CommitLineData
42546e6c
MG
1package Gruntmaster::Page::Index;
2
3use 5.014000;
4use strict;
5use warnings;
6use parent qw/Exporter/;
7our @EXPORT_OK = qw/generate/;
8our $VERSION = '0.001';
9
42546e6c 10use HTML::Template::Compiled;
2b0036ac 11use Gruntmaster::Page::Common qw/cook_templates reload_templates/;
42546e6c 12
2b0036ac 13my %orig_templates = (
42546e6c
MG
14 en => <<'HTML',
15HTML
16);
17
2b0036ac 18my %templates = cook_templates %orig_templates, index => 'Gruntmaster 6000';
42546e6c
MG
19
20sub generate{
2b0036ac 21 %templates = cook_templates %orig_templates, index => 'Gruntmaster 6000' if reload_templates;
cd9af27e 22 HTML::Template::Compiled->new(scalarref => \$templates{$_[1]})->output
42546e6c
MG
23}
24
251
This page took 0.021555 seconds and 4 git commands to generate.