On Wed, 15 Feb 2012 18:35:50 +0000 David Precious <davidp@preshweb.co.uk> wrote:
Probably the easiest, and most sane, way, would be for the before hook to get passed the route handler as a parameter.
That's a dead simple change to make, and should, I believe, do the job.
I'll check none of the other core devs object to this (I can't think why they would), then Make It So.
https://github.com/sukria/Dancer/pull/746 DC: feel free to check out that branch tomorrow and see if it works for you. I'll get this change merged soon assuming there are no objections, and hopefully we can get a new release out soon. FWIW, I had a very brief try at extracting sub attributes from the handler coderef and couldn't get it to work - but I also couldn't get it to work in a brief non-Dancer test case just creating a coderef with attributes then getting the attributes from it - so it's more likely a case of me Doing It Wrong. It's pubtime now, so I'll look again in the morning :) -- David Precious ("bigpresh") <davidp@preshweb.co.uk> http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedin www.preshweb.co.uk/facebook www.preshweb.co.uk/cpan www.preshweb.co.uk/github