Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Mojolicious absolute url with query in template?

by Corion (Pope)
on Mar 19, 2020 at 09:25 UTC ( #11114461=note: print w/replies, xml ) Need Help??


in reply to Re^2: Mojolicious absolute url with query in template?
in thread Mojolicious absolute url with query in template?

You don't give any argument to ->query(), so the query part is empty. If you want query parameters, you have to give them to the method, like haukex already demonstrated.

<a href="<%= url_for('/')->to_abs->query( foo => 'bar' )%>"> Reload </ +a>

If you want to keep the current query parameters, you need to pass those into your template.

Replies are listed 'Best First'.
Re^4: Mojolicious absolute url with query in template?
by haukex (Chancellor) on Mar 19, 2020 at 09:48 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2020-05-27 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (152 votes). Check out past polls.

    Notices?