Wednesday, March 12, 2014

Template Toolkit Debugging inside of Perl Dancer

The other day someone was asking how to enable Template Toolkit debugging inside of Perl Dancer in the #dancer IRC channel, it seemed like a good time for a write up.

The template engine configuration directive supports passing through various options like start_tag and stop_tag as explained in Dancer::Template::TemplateToolkit POD. And alludes to being able to pass other options.

How

To pass TT options like those found in Template::Constants, there must be a DEBUG section in engines -> template_toolkit, usually found in config.yml.

Example Snippet

Here is an example:

A few notes

  • Remove leading DEBUG_ from TT constants. The option DEBUG_PLUGINS becomes plugins.
  • Multiple options can be separated with a comma. Example:DEBUG: "provider,plugins".
  • Be warned, some of these options can lead to tons of information :)
__END__

3 comments:

  1. This blog is having the general information. Got a creative work and this is very
    different one. We have to develop our creativity mind. This blog helps for this.
    Thank you for this blog. this is very interesting and useful.
    Digital Marketing Company in Chennai

    ReplyDelete
  2. Wow, this blog is very nice I really like your blog and Impressive thank you very much for posting this blog.
    Oracle Fusion HCM Technical Training

    ReplyDelete