0
我有一个观点:如何把一个变量的笨temaplate
public function index()
{
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
if ($lang == "fr"){
$this->smarty->display('excel.tpl');
}
else{
$this->smarty->display('excel_eng.tpl');
}
}
我的模板:
<div class="fullscreen background" id="landing-page-image">
{include 'components/menu.tpl'}
</div>
我想更换取决于语言的组件
如何做它?
如何把变量放在{include'components/variable here'}? – Mark 2014-11-03 12:43:33
为什么从一开始就使用不同的模板时传递一个var? – akmozo 2014-11-03 12:49:47
我编辑了我的答案,将var传递给模板。 – akmozo 2014-11-03 13:04:49