Skip Menu |

This queue is for tickets about the Module-Starter-Plugin-TT2 CPAN distribution.

Report information
The Basics
Id: 15027
Status: resolved
Priority: 0/
Queue: Module-Starter-Plugin-TT2

People
Owner: Nobody in particular
Requestors: dakkar [...] thenautilus.net
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.12
Fixed in: (no value)



Subject: Patch to pass parameters to the TT2 renderer
The attached patch fixes a very minor bug ('render' called 'renderer' instead of using '$self->{renderer}'), and adds the ability to pass parameters to the Template constructor. I use this to pass 'RELATIVE=>1' and factor my templates (e.g. the licensing terms have to be included in the README and in every .pm file, so I put them in a common template). Hope this is useful.
--- .cpanplus/5.8.6/build/Module-Starter-Plugin-TT2-0.12/lib/Module/Starter/Plugin/TT2.pm 2004-10-20 04:55:27.000000000 +0200 +++ Library/Perl/Module/Starter/Plugin/TT2.pm 2005-09-15 16:12:24.000000000 +0200 @@ -72,7 +72,11 @@ =cut -sub renderer { my $renderer = Template->new; } +sub renderer { + my ($self) = @_; + my $conf = (eval $self->{template_parms})||{}; + my $renderer = Template->new($conf); +} =head2 C<< render( $template, \%options ) >> @@ -90,7 +94,7 @@ $options->{self} = $self; $options->{year} = $self->_thisyear; - $self->renderer->process(\$template, $options, \$output); + $self->{renderer}->process(\$template, $options, \$output); return $output; }
applied, released -- rjbs