summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2011-09-29 04:00:25 -0500
committerJesse Luehrs <doy@tozt.net>2011-09-29 04:00:25 -0500
commit2b8b1208ad357d3e8558e9b34cb99e5a299887b8 (patch)
treeb1ddb9153c191d215048dbdb9a34fa123623dbac /lib
parent25b489a34ad55818a7407ce32f3c89968a1d240f (diff)
downloadox-view-tt-2b8b1208ad357d3e8558e9b34cb99e5a299887b8.tar.gz
ox-view-tt-2b8b1208ad357d3e8558e9b34cb99e5a299887b8.zip
allow routing directly to the view
Diffstat (limited to 'lib')
-rw-r--r--lib/OX/View/TT.pm11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/OX/View/TT.pm b/lib/OX/View/TT.pm
index 33e5e7c..df6461a 100644
--- a/lib/OX/View/TT.pm
+++ b/lib/OX/View/TT.pm
@@ -51,6 +51,17 @@ sub render {
$out;
}
+sub template {
+ my $self = shift;
+ my ($r) = @_;
+
+ my %params = $r->mapping;
+ confess("Must supply a 'template' parameter")
+ unless exists $params{template};
+
+ return $self->render($r, $params{template}, {});
+}
+
__PACKAGE__->meta->make_immutable;
no Moose; 1;