|
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 |
Anna2727 Smarty n00b
Joined: 09 Jan 2019 Posts: 2
|
Posted: Wed Jan 09, 2019 7:59 am Post subject: Replace header.tpl changed to header2.tpl when changing lang |
|
|
Здравствуйте,
Может кто знает, как реализовать чтобы header.tpl менялся на header2.tpl при смене языка на сайте, пример, при переключений на английский https://www.domain.com/en/ подключался header2.tpl, кто знает дайте код, скажу спасибо= vmr. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Thu Jan 10, 2019 1:43 pm Post subject: |
|
|
Для этого надо передать язык в настройки Smarty.
Например, через compile_id.
И я настоятельно советую сменить именование файлов на вменяемое.
Например, header-ru.tpl и header-en.tpl
Тогда код вырождается в
Code: | {include "header-{$smarty.template_object->getCompileId()}.tpl"} |
|
|
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
|