On 17 December 2010 00:53, Naveed Massjouni <naveedm9@gmail.com> wrote:
On Thu, Dec 16, 2010 at 6:43 PM, David Precious <davidp@preshweb.co.uk> wrote:
I believe they're already passed in under params, so you can use e.g.:
[% params.foo %]
Not 100% certain, though.
-- David Precious <davidp@preshweb.co.uk> Sent from my phone so please excuse brevity / poor quoting style etc
Whoa, you are right, in the template you can access params. So now I know of 3 things Dancer provides you in the templates: request, session and params. Are there any others? Lets document this somewhere. Maybe in the Dancer::Template pod?
-Naveed
You also have the settings : that's what the template keyword sends to the templating system : $tokens->{dancer_version} = $Dancer::VERSION; $tokens->{settings} = Dancer::Config->settings; $tokens->{request} = Dancer::SharedData->request; $tokens->{params} = Dancer::SharedData->request->params; and the session if it exists