[Templates-cvs] cvs commit: TT3/lib/Template Component.pm

cvs@template-toolkit.org cvs@template-toolkit.org
Fri, 10 Dec 2004 18:51:39 +0000


cvs         04/12/10 18:51:39

  Modified:    lib/Template Component.pm
  Log:
  * use variables passed to process() as variables in child context
  
  Revision  Changes    Path
  1.9       +5 -5      TT3/lib/Template/Component.pm
  
  Index: Component.pm
  ===================================================================
  RCS file: /template-toolkit/TT3/lib/Template/Component.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Component.pm	2004/12/10 14:59:47	1.8
  +++ Component.pm	2004/12/10 18:51:39	1.9
  @@ -15,7 +15,7 @@
   #   modify it under the same terms as Perl itself.
   #
   # REVISION
  -#   $Id: Component.pm,v 1.8 2004/12/10 14:59:47 abw Exp $
  +#   $Id: Component.pm,v 1.9 2004/12/10 18:51:39 abw Exp $
   #
   #========================================================================
   
  @@ -27,7 +27,7 @@
   use Template::Base;
   use base qw( Template::Base );
   
  -our $VERSION   = sprintf("%d.%02d", q$Revision: 1.8 $ =~ /(\d+)\.(\d+)/);
  +our $VERSION   = sprintf("%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/);
   our $DEBUG     = 0 unless defined $DEBUG;
   our $ERROR     = '';
   our $THROW     = 'component';
  @@ -227,7 +227,7 @@
   
   
   sub process {
  -    my ($self, $context) = @_;
  +    my ($self, $context, $variables) = @_;
       my $template = $self->{ template }
           || return $self->error('no template defined');
   
  @@ -237,7 +237,7 @@
   
       $context = $context->child({
           templates => $self->{ templates },
  -        variables => { },
  +        variables => $variables,
       });
   
       $self->{ _HOT } = 1;
  @@ -340,7 +340,7 @@
   
   =head1 VERSION
   
  -$Revision: 1.8 $
  +$Revision: 1.9 $
   
   =head1 COPYRIGHT