'How to get base url in cs cart view file

I am now analysis and working now cs cart.I don't know how to get base url in cs cart(php and tpl file)??.please help me.my cs cart version 4.5.2.

many time my self searched google.But i don't have the results.


Solution 1:[1]

base url in php:

fn_url('');

base url in tpl:

{''|fn_url}

Solution 2:[2]

base URL is actual your domain: http://example.com/ without the controller. If you want to get both current URL and controller of the page you are working on, you should use this:

{$config.current_url|fn_url}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ivan Danshin
Solution 2 Kiriakos Grhgoriadhs