1 package Apache::MVC::View::TT;
2 use Lingua::EN::Inflect;
5 use UNIVERSAL::moniker;
7 sub template_root { "/opt/houseshare/templates" } # For now
9 sub new { bless {}, shift } # Not worth having
13 my $root = $self->template_root;
14 my $template = Template->new({ INCLUDE_PATH => [
16 File::Spec->catdir($root, $r->model_class->moniker),
17 File::Spec->catdir($root, "custom"),
18 File::Spec->catdir($root, "factory")
22 class => $r->model_class,
23 objects => $r->objects,
27 # User-friendliness facility for custom template writers.
28 if (@{$r->objects} > 1){
29 $args{$r->model_class->plural_moniker} = $r->objects;
31 ($args{$r->model_class->moniker}) = @{$r->objects};
34 $template->process($r->template, \%args);