模板 获取指定用户ID的用户名

1、在控制器文件中(/app/exam/contorller/discuss.app.php)加入代码

$this->tpl->assign('users',$this->user->getUsersByArgs());

1.png

2、模板文件中(/app/exam/tpls/app/discuss.tpl)加入代码

{x2;$users[v:question['discuss_userid']]['username']}

2.png

文章导航