I’m having a problem that probably have a simple solution. In my website a user can have multiple followers, I want to list that followers using a ListView
To access to all followers from a user I can do someting like this:
$user = \common\models\User::findOne(['username' => $username]);
if($user === null)
throw new NotFoundHttpException(Yii::t('app', 'The requested page does not exist.'));
$followers = $user->followers;
But now I must create a dataprovider to pass to the ListView widget, how can I do this?