Subject: | Problem passing TT options |
Date: | Sun, 07 Nov 2010 00:27:49 +0100 |
To: | bug-MojoX-Renderer-TT [...] rt.cpan.org |
From: | Angelo Selvini <info [...] endum.net> |
In the documentation, to pass Template Toolkit's options I should write
something like
$self->plugin(tt_renderer => {FILTERS => [ ... ]});
So I've tried:
$self->plugin('tt_renderer' =>
{ CACHE_SIZE => 4096
, COMPILE_EXT => '.xc'
}
);
$Template::Provider::DEBUG = 1;
It doesn't work as the provider dump shows
[Template::Provider] creating cache of 128 slots for [ script/../templates ]
[Template::Provider] _fetch(script/../templates/example/welcome.html.tt)
[Template::Provider] _load(script/../templates/example/welcome.html.tt,
script/../templates/example/welcome.html.tt)
[Template::Provider] _compile(HASH(0x92c6010),
script/../tmp/ctpl/script/../templates/example/welcome.html.tt.ttc)
Adding the key template_options as read in source at line 44
$self->plugin('tt_renderer' => { template_options =>
{ CACHE_SIZE => 4096
, COMPILE_EXT => '.xc'
}
}
);
It worked properly:
[Template::Provider] creating cache of 4096 slots for [
script/../templates ]
[Template::Provider] _fetch(script/../templates/example/welcome.html.tt)
[Template::Provider] _load(script/../templates/example/welcome.html.tt,
script/../templates/example/welcome.html.tt)
[Template::Provider] _compile(HASH(0x9062cb0),
script/../tmp/ctpl/script/../templates/example/welcome.html.tt.xc)
I'm using Mojolicious-0.999936
<http://search.cpan.org/%7Ekraih/Mojolicious/lib/Mojolicious/Plugin/I18n.pm>
and MojoX-Renderer-TT-0.40.
Could you fix this behaviour?
Thank you.
Angelo