我不会做这样的事情
$this->ss->assign("questions", $array);
$this->ss->assign("questionsAns", $qsFullAns);
和smarty这样的东西:
$var = $array[$qsFullAns];
我该怎么做?
答案 0 :(得分:2)
http://www.smarty.net/docsv2/en/language.syntax.variables.tpl
{$foo.$bar} <-- display variable key value of an array, similar to PHP $foo[$bar]
至于$var = $array[$qsFullAns];
{assign var=var value=$questions.$questionsAns}
{$var}
现在是$var = $array[$qsFullAns];