smarty模版页面递归调用

smarty模版页面递归调用

{function printtype level=0}

{foreach $data as $v}

{if $pid eq $v.type_pid}

{call printtype data=$data pid=$v.type_id level=$level+1}

{else}

{continue}

{/if}

{/foreach}

{/function}

{call printtype data=$types pid=0 level=0}