$this->view->assign('title','用户管理');
//模板赋值为空时
$this->view->assign('empty','<span style="color: red;">没有任何数据</span>');
$this->view->assign('userLiset',$userList);
//5.渲染出用户列表的模板
return $this->view->fetch('userLiser');
前端代码
{volist name="userList" id="user" empty="$empty"}
<tr>
<td>{$user.id}</td>
<td>{$user.name}</td>
<td>{$user.email}</td>
<td>{$user.mobile}</td>
<td>{$user.create_time}</td>
<td>{$user.status}</td>
<td><a href="">编辑</a></td>
<td><a href="">删除</a></td>
</tr>
{/volist}