General developer forum

Users/Cohorts list in form

 
Picture of Benedetto Zambetti
Users/Cohorts list in form
 

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 smile

 
Average of ratings: -
Picture of manolescu dorel
Re: Users/Cohorts list in form
 

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



 
Average of ratings: -