smarty获得当前url的方法分享
http://{$smarty.server.SERVER_NAME}/{$smarty.server.REQUEST_URI}
注释:
{$smarty.server.SERVER_NAME}//表示:服务器名称
{$smarty.server.REQUEST_URI}// 表示:请求的url
例如:http://www.loupesusa.com/understanding-dental-loupes.html 代码如下:
{$smarty.server.SERVER_NAME} //表示:www.loupesusa.com
{$smarty.server.REQUEST_URI}// 表示:understanding-dental-loupes.html
|