Hello guys!
I created a custom finder in UsersTable to find all Users associated to a specific Group. The finder works well so far. Now I also want to use the finder for filling a HTML-Select dropdown with that data, and here it fails.
The finder
public function findAdmins(Query $query, array $options) { return $query->matching('Groups', function($q) { return $q->where(['Groups.title' => 'Administrators']); }); }
The Controller-Action “add”
$lawyers = $this->Files->Users->find(‘Administrators’, [‘limit’ => 200])->toList();
The Result in HTML-Select Dropdown
1-Line-JSON-String of the whole object. e.g.:
entry no.1: {“id”:4,“username”:“admin”…}
entry no.2: {“id”:6,“username”:…}
Data as of DebugKit
admins(array)->4(array)->properties…
admins(array)->6(array)->properties…
Am I unable to use that finder for an html select? Do I really have to create a second one specific for html-selects?
Thanks in advance!