Home · Latest · Trends  /  PHP
15

How to get the current url in smarty

rated 17 times [  16] [ 1]  / comments: 1 / hits: 3823  / 3 years ago, sat, sep 10, 2016, 15:19:13
How to get the current url in smarty file
{$smarty.server.HTTP_HOST}{$smarty.server.REQUEST_URI}
More From » PHP
 

Comments

7
php file:
Code:
$link =  "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
$smarty->assign('link',$link);
template file:
Code:
{$link}
[#5] Tuesday, April 25, 2017, 08:59:48
 
info
commented 2 years ago
Only authorized users can post. Please sign in first, or register a free account
 
Share
Snippets
Smarty sort foreach results in Smarty file
3 years ago, sat, sep 10, 2016
Validate domain name with PHP gethostbyname
3 years ago, sat, sep 10, 2016
List all files in Zip archive with PHP
3 years ago, sat, sep 10, 2016
Grabbing a Favicon from external website
3 years ago, tue, feb 21, 2017
Sponsor
Posted
Michael

Michael

Member since Sep 10, 2016
Total Code Snippets: 5
Total Comments: 0
Location: n/a
Following
User not following anyone yet.