From 2b8b1208ad357d3e8558e9b34cb99e5a299887b8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Thu, 29 Sep 2011 04:00:25 -0500 Subject: allow routing directly to the view --- lib/OX/View/TT.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib') 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; -- cgit v1.2.3-54-g00ecf