Home >Backend Development >PHP Tutorial >thinkphp template assignment problem

thinkphp template assignment problem

WBOY
WBOYOriginal
2016-10-17 09:30:231101browse

<code class="php">$User = M('User');
$list = $User->limit(10)->select();
$this->assign('list',$list);

<volist name="list" id="vo">
{$vo.select}<br/>
</volist>
</code>

If my {$vo.select} is still an array at this time, how can I traverse this array in the template?

Reply content:

<code class="php">$User = M('User');
$list = $User->limit(10)->select();
$this->assign('list',$list);

<volist name="list" id="vo">
{$vo.select}<br/>
</volist>
</code>

If my {$vo.select} is still an array at this time, how can I traverse this array in the template?

Nest another volist

<code><volist name="vo.select" id="selecter">
    {{ selecter.name }}
</volist></code>
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