[dancer-users] Dancer2 Basic YAML question

Andrew Solomon andrew at geekuni.com
Wed Aug 19 21:49:39 BST 2015


No guarantees, but try this:

template: "template_toolkit"
session: Cookie
engines:
   template:
     template_toolkit:
       start_tag: '<%'
       end_tag:   '%>'
   session:
     Cookie:
       secret_key: yoursecretpassphrase
       default_duration: 604800


which in Perl speak is something like

{
   engines => { template => ... , session => ...},
}

as opposed to what you had which meant:

{
   engines => { template => ... },
   engines => { session => ...  },
}

where the second overwrites the first. Why it was the other way around
in your example is a mystery to me though.

Andrew

On Wed, Aug 19, 2015 at 6:30 PM, David H <untg99 at gmail.com> wrote:
> Hi All,
>
> I've put this into a config.yml file and it isn't working really at all and
> I'm guessing there is something basic going on that I don't know about.
>
> template: "template_toolkit"
> engines:
>    template:
>      template_toolkit:
>        start_tag: '<%'
>        end_tag:   '%>'
>
> session: Cookie
> engines:
>    session:
>      Cookie:
>        secret_key: yoursecretpassphrase
>        default_duration: 604800
>
>
> When I put in the session: Cookie line after the template toolkit line, it
> gives me an error about not having a secret_key.
> When I put the section before it, it just return <% content %> on every
> page, presumably because something is failing after the cookie section or my
> .yml formatting is completely wrong...
>
> Can I please have some pointers as to where exactly I'm going wrong here?
>
> Thanks in advance,
>
> David
>
>
> _______________________________________________
> dancer-users mailing list
> dancer-users at dancer.pm
> http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>



-- 
Andrew Solomon

Mentor at Geekuni http://geekuni.com/
http://www.linkedin.com/in/asolomon


More information about the dancer-users mailing list