[dancer-users] TT default layout

Jason A. Crome cromedome at gmail.com
Wed Nov 4 17:21:26 GMT 2015


skel/ contains *our* templates for generating a new application. We use [% %] in our templates when we generate a new application. If we used all [% %] or <% %>, the tags for the sample app would get processed out when we generated a new application. So by having two sets of tags, we can use one set generating the app, and leaving the second set intact in the skeleton application.

Good question :)  Does my answer make sense?

Jason

> On Nov 4, 2015, at 11:15 AM, Rick Leir <richard.leir at canadiana.ca> wrote:
> 
> Why would there be both [% and <% in the default layout? Am I missing something?
> 
> Dancer2$ more share/skel/views/layouts/main.tt 
> <!DOCTYPE html>
> <html lang="en">
> <head>
>   <meta charset="<% settings.charset %>">
>   <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
>   <title>[% appname %]</title>
>   <link rel="stylesheet" href="<% request.uri_base %>/css/style.css">
> 
> <!-- Grab jQuery from a CDN, fall back to local if necessary -->
> <script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
> <script type="text/javascript">/* <![CDATA[ */
>     !window.jQuery && document.write('<script type="text/javascript" src="<% request.uri_base %>/javascripts/jquery.js"><\/script>')
> /* ]]> */</script>
> 
> </head>
> <body>
> <% content %>
> <div id="footer">
> Powered by <a href="http://perldancer.org/">Dancer2</a> <% dancer_version %>
> </div>
> </body>
> </html>
> -- 
> Cheers -- Rick 
> 
> _______________________________________________
> 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