[Jifty-commit] r3444 - in Template-Declare/lib/Template: Declare

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Mon Jun 11 17:46:27 EDT 2007


Author: clkao
Date: Mon Jun 11 17:46:24 2007
New Revision: 3444

Modified:
   Template-Declare/lib/Template/Declare.pm
   Template-Declare/lib/Template/Declare/Tags.pm

Log:
Allow _dispatch_template method in TD classes to do final tuning before
actually invokes the templates.


Modified: Template-Declare/lib/Template/Declare.pm
==============================================================================
--- Template-Declare/lib/Template/Declare.pm	(original)
+++ Template-Declare/lib/Template/Declare.pm	Mon Jun 11 17:46:24 2007
@@ -376,6 +376,12 @@
     }
 }
 
+sub _dispatch_template {
+    my $class = shift;
+    my $code  = shift;
+    unshift @_, $class;
+    goto $code;
+}
 
 sub _find_template_sub {
     my $self    = shift;

Modified: Template-Declare/lib/Template/Declare/Tags.pm
==============================================================================
--- Template-Declare/lib/Template/Declare/Tags.pm	(original)
+++ Template-Declare/lib/Template/Declare/Tags.pm	Mon Jun 11 17:46:24 2007
@@ -47,9 +47,8 @@
     # template "foo/bar" ==> CallerPkg::_jifty_template_foo/bar;
     my $codesub = sub {
         local $self = shift || $self || $template_class;
-
-        #local $self = $template_class unless $self;
-        &$coderef($self, at _);
+        unshift @_, $self, $coderef;
+        goto $self->can('_dispatch_template');
     };
 
     if (wantarray) {


More information about the Jifty-commit mailing list