Reputation: 12802
I'd like to add my own directives to Template Toolkit instead if adding functions and/or virtual methods via the plugin system. Is this easily doable without delving too deep into Template::Grammar
? And are there any examples I could study on CPAN?
Upvotes: 5
Views: 627
Reputation: 3167
Personally I've found the best way to extend TT's behaviour is to shove subrefs in the stash:
$stash = { clever => \&do_something};
Upvotes: 2
Reputation: 46497
Does the MACRO directive which is described in Template::Manual do what you want?
Upvotes: 5