How can I get current URL using smarty

user1187 picture user1187 · Oct 30, 2012 · Viewed 84.5k times · Source

How to get URL using Smarty similar to window.location in JavaScript ?

I did this

{$smarty.server.PHP_SELF} 

but it's not working.

Answer

sertaconay picture sertaconay · Apr 19, 2013

You can use this, too.

{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}