|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
ashok9999 Smarty n00b
Joined: 13 Nov 2017 Posts: 1
|
Posted: Fri Nov 17, 2017 4:35 am Post subject: meaning of the smarty code |
|
|
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 |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Nov 17, 2017 4:39 pm Post subject: |
|
|
Without knowing the content of each variable, I could only guess that they used it to prevent ambiguity of relative path reference. |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Fri Nov 17, 2017 5:03 pm Post subject: |
|
|
The theme publisher is making it so that the template need not be changed for each sub-theme that could exist, and for installations that may exist in a sub-folder.
There should be a theme descriptor file where the sub-themes can be defined. Then, {$system['theme']} could be:
my_theme/steel_blue
and {$system['system_url']} could be:
www.mysite.com/wholesale_store
This allows for arbitrary flexibility where otherwise, one would need to specifically find the relevant statements and re-code all templates in a theme. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|