I want to use URL of current page in all my pages on my site for creating link button.
I can do the following in my controller:
Http.Request.current().getBase() + Http.Request.current().url;
But how can I do this in view? Is there direct way?
You can access the Http.Request.current()
in the view, as simply request
.
So, you need
${request.getBase()}${request.url}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With