Why would you prefer this to the standard Template engine that Dancer ships in core? I am not about to advocate it here; our experience is that Template::Alloy provided a significant reduction in unintended behaviour in templates, but your millage may vary significantly.

In order to use this engine, use the template setting:

template: alloy

This can be done in your config.yml file or directly in your app code with the set keyword.

Note that by default, Dancer configures the Template::Alloy engine to use the standard Template::Toolkit [% and %] brackets; the Dancer default of <% %> brackets will require manual changes. This can be changed within your config file - for example: