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

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

WBOY
Release: 2016-06-13 13:18:05
Original
888 people have browsed it

请教个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,具体用法看下手册
    Related labels:
    source:php.cn
    Statement of this Website
    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
    Popular Tutorials
    More>
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template