[dancer-users] tt tags

Sawyer X xsawyerx at gmail.com
Sat Jan 23 17:01:03 GMT 2016


Dancer sets the template tags by default (and the Simple default
template engine uses them as well) to '<%' and '%>' for two somewhat
non-interesting reasons:

1. The way it is in Sinatra.
2. Angle brackets are used in HTML so one can claim it looks better.

Good or bad, it's the way it is. The default template engine seems
very similar to Template::Toolkit (of course only allows variables,
because it's *simple*) since we like Template::Toolkit. It's hard to
argue that we should optimize for it, since many templating systems
have a different way of providing variables:

Text::Template: {$var}
HTML::Template: <TMPL_VAR var>
Text::Xslate: <: $var :>

So... yeah, it's an odd situation. Most systems basically give you one
template engine or super optimize for one, we do neither. We try to
stay out of your way - for good and bad.

But, since TT is so popular and this question comes up a lot, we have
the configuration there ready for your to just uncomment it and use

On Wed, Jan 20, 2016 at 4:18 PM, Rick Leir <richard.leir at canadiana.ca> wrote:
> On Tue, Jan 19, 2016 at 7:00 AM, <dancer-users-request at dancer.pm> wrote:
>>    [KB] I know that start and end tags of template toolkit can be
>> defined at config.yml but my problem is that .tt file does not accept
>> the tags I defined at config.yml. I defined as follow.
>>  template: "template_toolkit"
>> engines:
>>   template:
>>     template_toolkit:
>>       start_tag: '<%'
>>       end_tag:   '%>'
> Sorry for the delay, I was 'otherwise occupied'. And sorry for the changed
> thread, I receive daily digests so when I rely I have to set the Subject
> manually.
> My memory from November is that Dancer2 uses '<%' internally, and I had to
> use '[%' to avoid conflicts. But I am new to this, please correct
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

More information about the dancer-users mailing list