12 Oct
2011
12 Oct
'11
11:06 p.m.
Hello, Has anyone managed to add a custom Template-Toolkit Filter when using Dancer ? Using TT directly, the code would looks like this: ====== sub my_custom_filter { my $text = shift ; ## Do something to $text; return $text; } my $tt = Template->new( { FILTERES => { 'my_custom_filter' => \&my_custom_filter } }); ====== Using Dancer, I see the TT->New() call is in "Dancer/Template/TemplateToolkit.pm", and I could even possibly add configuration options using "config.yml", but how do I specify a reference to a sub in my code ? Any suggestions will be appropriated, Thanks, -assaf.