Reputation: 159
I'm new to smarty and I'm seeing this line
<link rel="shortcut icon" href="
{$system['system_url']}/themes/{$system['theme']}/images/favicon.png" />
This line is used to set favicon but they can use direct the image url "images/favicon.png" so why they used
Upvotes: 0
Views: 58
Reputation: 1838
It is a best practice to isolate different resources as much as possible. Referencing a static file such as a favicon directly creates a direct link between the web framework and web layout.
Using the types of variables you see in your example, makes the path address to the favicon dynamic so if the app where to be moved, or renamed, the links between layout and framework would still work without needing to manually change all path addresses.
Upvotes: 1