userlisting and sorting

Permalink
Hi, i have created a single page and i would like to list all the users in a specific group
im trying to follow the documentation but i cant get the users to show up... please help im a bit new

 
mohammedfaqruddin replied on at Permalink Reply
mohammedfaqruddin
Refer this https://www.concrete5.org/documentation/general-topics/user-manageme...

You can also add each user by editing the profile, at the bottom it shows group check the group to add the user. The user is now in that assigned group.
Mobileknights replied on at Permalink Reply
but it does not say how to show the users and it seems like its made for 5.6 not 5.7

http://documentation.concrete5.org/developers/users-groups/searchin...
i found this but it does not say how to make the showing of the users work?
hutman replied on at Permalink Reply
hutman
You can do something like this

use Concrete\Core\User\UserInfo;
$list = new \Concrete\Core\User\UserList();
$list->filterByGroup('Administrators');
$users = $list->get(999);
foreach($users as $user){
    $userID = $u->getUserID();
    $ui = UserInfo::getByID($userID);
    echo '<p>'.$ui->getUserName().' - '.$ui->getUserEmail().'</p>';
}