Users/Cohorts list in form

Users/Cohorts list in form

von Benedetto Zambetti -
Anzahl Antworten: 1

Hi Everybody.

What is the best way to implement a users' or cohorts' list in a plugin's form?

How can I pass the list to a form, what is the element or function?

I wait to a reply, thanks lächelnd

Als Antwort auf Benedetto Zambetti

Re: Users/Cohorts list in form

von Dorel Manolescu -
Nutzerbild von Plugin developers

Hi

For users list : I don t think is a good idea to have a drop-down with all the users in your form as it will cause performance issues to the limit of the page not being responsive. 

I suggest you to use the 'user filter' moodle component mixed with your other form items. (see screen-shot of user filter from ../admin/user.php ). Search the code for:  $ufiltering = new user_filtering('', '', array()); to see how you can use it.

Also this is a great resource on how to use forms: https://docs.moodle.org/dev/Form_API

Let us know!

Regards


Anhang filtering.png