[Templates-cvs] cvs commit: Template2/lib/Template Document.pm
cvs@template-toolkit.org
cvs@template-toolkit.org
Tue, 14 Oct 2003 10:40:37 +0100
cvs 03/10/14 09:40:37
Modified: lib/Template Document.pm
Log:
* changed process() method to pass $self to visit() method
Revision Changes Path
2.67 +25 -15 Template2/lib/Template/Document.pm
Index: Document.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Document.pm,v
retrieving revision 2.66
retrieving revision 2.67
diff -u -r2.66 -r2.67
--- Document.pm 2003/07/24 16:16:27 2.66
+++ Document.pm 2003/10/14 09:40:37 2.67
@@ -20,7 +20,7 @@
#
#----------------------------------------------------------------------------
#
-# $Id: Document.pm,v 2.66 2003/07/24 16:16:27 abw Exp $
+# $Id: Document.pm,v 2.67 2003/10/14 09:40:37 abw Exp $
#
#============================================================================
@@ -33,7 +33,7 @@
use base qw( Template::Base );
use Template::Constants;
-$VERSION = sprintf("%d.%02d", q$Revision: 2.66 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.67 $ =~ /(\d+)\.(\d+)/);
#========================================================================
@@ -81,10 +81,10 @@
} values %$defblocks;
bless {
- %$metadata,
- _BLOCK => $block,
- _DEFBLOCKS => $defblocks,
- _HOT => 0,
+ %$metadata,
+ _BLOCK => $block,
+ _DEFBLOCKS => $defblocks,
+ _HOT => 0,
}, $class;
}
@@ -131,20 +131,22 @@
# check we're not already visiting this template
return $context->throw(Template::Constants::ERROR_FILE,
- "recursion into '$self->{ name }'")
- if $self->{ _HOT } && ! $context->{ RECURSION }; ## RETURN ##
+ "recursion into '$self->{ name }'")
+ if $self->{ _HOT } && ! $context->{ RECURSION }; ## RETURN ##
- $context->visit($defblocks);
+ $context->visit($self, $defblocks);
+
$self->{ _HOT } = 1;
eval {
- my $block = $self->{ _BLOCK };
- $output = &$block($context);
+ my $block = $self->{ _BLOCK };
+ $output = &$block($context);
};
$self->{ _HOT } = 0;
+
$context->leave();
die $context->catch($@)
- if $@;
+ if $@;
return $output;
}
@@ -466,8 +468,8 @@
=head1 VERSION
-2.65, distributed as part of the
-Template Toolkit version 2.10, released on 24 July 2003.
+2.66, distributed as part of the
+Template Toolkit version 2.10a, released on 09 October 2003.
=head1 COPYRIGHT
@@ -478,5 +480,13 @@
modify it under the same terms as Perl itself.
=head1 SEE ALSO
+
+L<Template|Template>, L<Template::Parser|Template::Parser>
+
+=cut
-L<Template|Template>, L<Template::Parser|Template::Parser>
\ No newline at end of file
+# Local Variables:
+# mode: perl
+# perl-indent-level: 4
+# indent-tabs-mode: nil
+# End: