show two tables in one page

Hi,

In my system I have a class: User with attributes [username,created_at,active…]

I want to show in my admin.php not one table like it’s generated, but 2 tables: one for active and one for not active users.

I still want to keep the filtering and sorting capabilities as done in the original page.

My half solution:

In order not to duplicate the table code, I created a file: _admin.php that contains only the table code.

Inside admin.php I call to _admin.php using render partial.

Now the problem:

Usually, in the controller, you write something like:


if(isset($_GET['User'])){

  $model->attributes=$_GET['User'];

}



so that the filtering/sorting will work.

My problem is that I created 2 models. One for activated and one for not. But both of them of the same type, meaning I can’t use:




if(isset($_GET['User'])){

  $model->attributes=$_GET['User'];

}

if(isset($_GET['User'])){

  $model2->attributes=$_GET['User'];

}



Can you tell me how to solve this issue?

Thanks