Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the current page URL in the view?

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?

like image 534
DyK Avatar asked Jan 19 '12 07:01

DyK


1 Answers

You can access the Http.Request.current() in the view, as simply request.

So, you need

${request.getBase()}${request.url}
like image 161
Codemwnci Avatar answered Oct 06 '22 08:10

Codemwnci