[Dancer-users] messed up routes

Richard Huxton dev at archonet.com
Thu Oct 20 09:16:24 CEST 2011


On 20/10/11 04:51, Mr. Puneet Kishor wrote:
> In my last email to this
> forum, I noted that I would get different layout than was expected.
> Today I decided to do a little experimentation.

This caught me out too. The "set layout" changes a setting, and it's 
persistent.

So - once it's set it stays set for any further requests, until you set 
it to something else. Which, if you're trying to use it like you are 
(and I did) is not helpful.

Mathhew's recommendation is right - add an options hashref to the 
template call and you can set it just for that template (which is what I 
usually want).

Why have it the other way? Presumably it's useful if you want to switch 
layouts because e.g. the user is viewing the site from their phone, or 
has chosen an accessible layout etc.

-- 
   Richard Huxton
   Archonet Ltd


More information about the Dancer-users mailing list