XF 2.1 Get the username from list

gaga

Member
Hello to all I need help.
In ACP I create the list where we need to show all users with the same custom_title and username.

e.x
If a user with username : gaga, have title gaga.

My code is
PHP:
     $username = // what need to put here to get username from each user in list

        $finder = \XF::finder('XF:User');
        $users = $finder
            ->where('custom_title', '=', $username)
            ->order('user_id','DESC')
            ->fetch();
 

Jeremy P

XenForo developer
Staff member
You can use a finder expression for this:
PHP:
$finder->where($finder->expression('%s = %s', 'custom_title', 'username'));
 
Top