سؤال

So let's say I have two tables: permissions, and sort of a join table between users and permissions that we'll call permission_list

permission_list has user_id and permission_id.

permission has the name of the permission and a keyname for use elsewhere in the code.

Now I have an assign permissions page, that currently uses a dropdown list of all the available permissions. What I want to have is a list of checkboxes, where permissions in the users list are checked already, and unchecking them removes those records, and checking new ones adds new records.

Does Symfony2 have a built-in way to go about this?

هل كانت مفيدة؟

المحلول

Does this answer your question How to render a checkbox that is checked by default with the symfony2 Form Builder?

Form Builder has a lot of great features that will help you accomplish what you are looking for.

That link references this link http://symfony.com/doc/current/book/forms.html that has a ton of info but he gives a good suggestion. Let me know if thats not clear enough.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top