Skip to content

How to Show All User #956

Locked Answered by datamweb
Junkwarior23 asked this question in Q&A
Nov 20, 2023 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

show all user with their group

This is a simple example, of course what you need is a little more knowledge. You may need to extend the model or even CodeIgniter\Shield\Entities\User. Or use the table join.

$users = auth()->getProvider();

// table 
$table = new \CodeIgniter\View\Table();
$table->setHeading(['username', 'Groups']);

foreach ($users->findAll() as $user) {
$groups =  implode(",", $user->getGroups());
$table->addRow([$user->username,$groups]);
echo $table->generate();
}

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@Junkwarior23
Comment options

@datamweb
Comment options

@Junkwarior23
Comment options

@datamweb
Comment options

Answer selected by Junkwarior23
@Junkwarior23
Comment options

@datamweb
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants