【发布时间】:2015-11-26 17:13:24
【问题描述】:
我在 .tpl 文件中使用 smarty,我有
{fetch file='http://domain.com/directory/{$wtc_location}/{$wtc_year}/{$wtc_stormname}.php'}
但它没有拉变量。我试过{$smarty.get.wtc_location} 仍然没有。加载变量的解决方案是什么?
提前致谢。
【问题讨论】:
-
你为什么说“它不拉变量”?如果即 $wtc_location 为空,则必须在模板或 php 文件中使用 $smarty->assign('wtc_location', 'some location'); 为其分配一些值
-
所有变量都设置好了,它只返回 [link]domain.com/directory{$wtc_location}/{$wtc_year}/{$wtc_stormname}.php[/link] 但我可以把那行放在外面的 fetch 并正确提取所有变量。
标签: smarty