[Catalyst-commits] r6327 - branches/Catalyst-View-TT-nothingmuch_constructor_refactoring/lib/Catalyst/View

nothingmuch at dev.catalyst.perl.org nothingmuch at dev.catalyst.perl.org
Fri Apr 27 03:22:17 GMT 2007


Author: nothingmuch
Date: 2007-04-27 03:22:17 +0100 (Fri, 27 Apr 2007)
New Revision: 6327

Modified:
   branches/Catalyst-View-TT-nothingmuch_constructor_refactoring/lib/Catalyst/View/TT.pm
Log:
refactor template processing to accept options

Modified: branches/Catalyst-View-TT-nothingmuch_constructor_refactoring/lib/Catalyst/View/TT.pm
===================================================================
--- branches/Catalyst-View-TT-nothingmuch_constructor_refactoring/lib/Catalyst/View/TT.pm	2007-04-27 02:14:40 UTC (rev 6326)
+++ branches/Catalyst-View-TT-nothingmuch_constructor_refactoring/lib/Catalyst/View/TT.pm	2007-04-27 02:22:17 UTC (rev 6327)
@@ -232,8 +232,12 @@
 	};
 }
 
-use constant template_class => 'Template';
+sub template_class {
+	my ( $self, $c, $config ) = @_;
 
+	$config->{TEMPLATE_CLASS} || 'Template';
+}
+
 sub process {
     my ( $self, $c ) = @_;
 
@@ -278,13 +282,17 @@
         [ @{ $vars->{additional_template_paths} }, @{ $self->{include_path} } ]
         if ref $vars->{additional_template_paths};
 
-    unless ($self->template->process( $template, $vars, \$output ) ) {
+	my @options = $self->template_options($c, $args);
+
+    unless ($self->template->process( $template, $vars, \$output, @options ) ) {
         return $self->template->error;  
     } else {
         return $output;
     }
 }
 
+sub template_options {}
+
 sub template_vars {
     my ( $self, $c ) = @_;
 




More information about the Catalyst-commits mailing list