Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: current route of perl dancer

by webfiend (Vicar)
on Feb 09, 2014 at 21:23 UTC ( #1074163=note: print w/replies, xml ) Need Help??


in reply to current route of perl dancer

You might be looking for the Dancer::Request method path. You get at a Dancer::Request object via request.

# in app.pl hook before_template_render => sub { my $tokens = shift; # Make the path available in every template. $tokens->{current_route} = request->path; }; # in views/layouts/main.tt <p>Route: <% current_route %></p>

Anything more elaborate than what I did, you'll probably want to create a custom helper.

Replies are listed 'Best First'.
Re^2: current route of perl dancer
by lightoverhead (Pilgrim) on Feb 10, 2014 at 19:46 UTC
    Thank you guys. Nice solution!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1074163]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2020-06-07 03:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you really want to know if there is extraterrestrial life?



    Results (42 votes). Check out past polls.

    Notices?