CakePHP 3.x : dynamic list of users with attributes


I’m trying to create a frequently called page with a window which contains the list of students who are currently on the site and are willing to be listed in this window. The order of students in the list is defined by the time when a student checks the box and after, let’s say, 30 minutes they are kicked out from this list in any case. The list should look like this:

student1 (250)
student2 (500)
student3 (10)

Next to the student’s name stays their rating in brackets. Every entry is a link to student’s profile and the name should be printed in either of three colors corresponding to the role of this particular student.

I have several approaches:

  1. One is to use existing students table with id, role and rating columns. I add a column e.g. listed which will be yes or no, depending on the checkbox state in student’s profile.
  2. I make a new table e.g. List, with student_id, student_role, student_rating and created to kick them from the list in time, and will populate it when the checkbox is checked.

Then I use AJAX following the examples here and here.

3.I use the View Cells.

Can one say what the most effective way in CakePHP 3.x would be?


Looks like you got it. How did it go?