Home  >  Article  >  Backend Development  >  请问个smarty模版技术的有关问题

请问个smarty模版技术的有关问题

WBOY
WBOYOriginal
2016-06-13 13:18:05858browse

请教个smarty模版技术的问题
请教下面的功能怎么在smarty模版中表现出来?谢谢。


for($i=1;$i$ttt = gettitle(rand(0,$TC));
?>

  • =$ttt?>

  • }?>

    ------解决方案--------------------
    看样子,是想循环一点东西出来,你可以这样

    你先在php文件里把 求出来的$ttt全放里一个数组里$t_arr,

    $smarty->assign('t_arr',$t_arr);

    然后,在模板文件里用foreach或者,setion遍历t_arr,具体用法看下手册
    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn