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

thinkphp template assignment problem

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-10-17 09:30:23
Original
1156 people have browsed it

$User = M('User');
$list = $User->limit(10)->select();
$this->assign('list',$list);

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

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

Reply content:

$User = M('User');
$list = $User->limit(10)->select();
$this->assign('list',$list);

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

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>
Copy after login

Related labels:
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