Smarty{fetch}in.tpl和变量

Smarty{fetch}in.tpl和变量,smarty,Smarty,我正在使用smarty,在.tpl文件中,我有 {fetch file='http://domain.com/directory/{$wtc_location}/{$wtc_year}/{$wtc_stormname}.php'} 但这并不是拉动变量。我尝试了{$smarty.get.wtc_location},但仍然一无所获。获取要加载的变量的解决方案是什么 提前谢谢 我明白问题所在。不能像调用模板一样调用smarty函数中的smarty变量,必须使用修饰符组合它: {fetch file=

我正在使用smarty,在.tpl文件中,我有

{fetch file='http://domain.com/directory/{$wtc_location}/{$wtc_year}/{$wtc_stormname}.php'}
但这并不是拉动变量。我尝试了
{$smarty.get.wtc_location}
,但仍然一无所获。获取要加载的变量的解决方案是什么


提前谢谢

我明白问题所在。不能像调用模板一样调用smarty函数中的smarty变量,必须使用修饰符组合它:

{fetch file='http://domain.com/directory/'|cat:$wtc_location|cat:'/'|cat:$wtc_year|cat:'/'|cat:$wtc_stormname|cat:'.php'}

你为什么说“这不是在拉变量”?如果$wtc_location为空,则必须在模板或php文件中使用$smarty->assign('wtc_location','some location')为其赋值;所有变量都已设置,它只返回[link]{$wtc_location}/{$wtc_year}/{$wtc_stormname}.php[/link],但我可以将该行带到fetch之外,并正确地将所有变量拉入。