Ashok
Ashok

Reputation: 159

what is the meaning of the following line in php smarty?

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

Answers (1)

pastaleg
pastaleg

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

Related Questions