Handling Checkboxes In Yii


I have a module which generates a list of contacts using crud.

Later, I have created checkboxes for each row in "Manage contacts" of admin.php page.

Now, I would like to create a submit button which saves the primary key field of the row into database.

How can I handle this?

Look at your $_POST array when submitted, this should tell you what to do.

Each item in the array should be the id of the record as key and the checkbox result as value (0=unchecked, 1=checked). Iterate through them with foreach and do what you gotta do (load a model, change it, save it).

Maybe this will help you link